// ==UserScript== // @name AV_AD_Block // @description missav // @icon https://static.missav.com/img/favicon.png // @namespace loadingi.local // @version 1.2 // @author ch // @match https://missav.com/* // @grant GM_setValue // @grant GM_getValue // --有 bug grant GM_xmlhttpRequest // @license GPL-3.0-only // @downloadURL none // ==/UserScript== (function() { 'use strict'; ////missav.com // 设置背景为纯黑,iPhone 顶部和底部将统一为黑色 document.body.style.backgroundColor = "black"; //Block Player OnceClick PopUp if(document.querySelector("div.flex-1.order-first")){ var elem0 = document.querySelector("div.flex-1.order-first").children[0] elem0.removeAttribute('x-init') elem0.removeAttribute('x-data') } if(document.querySelector("div.relative.-mx-4.-mt-6.sm\\:m-0")){ var elem1 = document.querySelector("div.relative.-mx-4.-mt-6.sm\\:m-0").children[0] elem1.removeAttribute(elem1.attributes[0].name) elem1.removeAttribute('@click.once') } //Block GIF AD function blockgif(){ // var elmt2 = document.querySelector('div.under_player') // 未知 var elmt1 = document.querySelector("link[href*='app.1aad5686.js']") //关键 js var elmt2 = document.querySelector("script[src*='app.1aad5686.js']") //关键 js var elmt3 = document.querySelector('div[class^="fixed right-2 bottom-2"') // 似乎未生效 var elmt4 = document.querySelector("script[src*='inpage.push.js']") // 推送iframe 的 js var elmt5 = document.querySelector("script[src*='hartattenuate.com']") // 可疑的 js var elmt6 = document.querySelector('div.space-y-5.mb-5') //页面底部广告 for (var i = 1; i<=6; i++){ var obj = eval('elmt'+i) console.log("Try elmt"+i) if(obj){ obj.remove(); console.log('Detection! Removed -------- elmt'+i); }else{continue} } //iframe blk 屏蔽所有 iframe // document.querySelectorAll("iframe").forEach(i => i.setAttribute('style','display:none')) document.querySelectorAll("iframe").forEach(i => { i.remove(); console.log('Detection! Removed -------- iframe'); }); } //Block Video AD function blockvideoad(){ var elem004 = document.querySelector('div[class^="rootContent--"]') console.log('trying') if(elem004){ console.log('Detection! Removed -------- rootContent--'); elem004.parentElement.remove(); //清除计时器 //clearInterval (timerVar); //timerVar= ""; } } //Block script function blockScript(){ var anchors = document.querySelectorAll("script"); for(var i=0;i0){ console.log("Detection! Removed -------- htmlAds") anchors[i].remove() break; }else{console.log("noMatch")} } } //LOOP var timerVar = setInterval (function() {blockProcc(); }, 50); var hits = 100 function blockProcc(){ //console.log('trying') blockgif(); blockScript(); blockvideoad(); hits-- console.log(hits) if(hits<=0){clearInterval (timerVar);console.log('exited');} } })();