针对在手机端访问网页时,妮可、嗨哆咪视频简单的广告过滤
当前为
// ==UserScript==
// @name 妮可,嗨哆咪,美剧社广告过滤
// @namespace https://www.yqsphp.com
// @version 1.0.13
// @description 针对在手机端访问网页时,妮可、嗨哆咪视频简单的广告过滤
// @author YQS
// @match *://www.nicotv.me/*
// @match *://www.haiduomi.cc/*
// @match *://m.meijushe.cc/*
// @require http://cdn.bootcss.com/jquery/1.8.3/jquery.min.js
// @grant none
// ==/UserScript==
(function() {
'use strict';
var domain = document.domain;
var nico = 'www.nicotv.me'; //妮可
var duomi = 'www.haiduomi.cc'; //嗨哆咪
var meiju = 'm.meijushe.cc'; //美剧
var doc = {
"nike":[
"body>object",
"a[id^=a__]",
".ff-ads",
"#mob",
"div[class^=nu71t_]",
"div[id^=v1468]",
"#zedbox32tkbfe",
"#b11468",
"table"
],
"duomi":[
"div[class^=__zy]",
"div[id^=v674]",
"span[id^=M]",
".fed-tabr-advs"
]
};
if(nico == domain){
//广告js
var adv = ["k.550tg.com","s13.cnzz.com","js.dakawm.cc"];
var s = $("script");
for(var i in s){
if($(s[i]).text()){
if($(s[i]).text().indexOf("var browser") != -1){
$(s[i]).remove();
}
}
if(s[i].src){
if(-1 != s[i].src.indexOf(adv[0]) || -1 != s[i].src.indexOf(adv[1]) || -1 != s[i].src.indexOf(adv[2])){
$(s[i]).remove();
}
}
}
var nav=$("body").css({"margin-top":0,"padding-top":0});
var nav=$(".navbar").css("margin-top",0);
setInterval(function(){
$("a[id^=a__]").parent().remove();
for(var i= 0; i < doc["nike"].length; i++){
$(doc["nike"][i]).remove();
}
var m = $("meta[name='description']").next();
if(m.get(0).tagName == "STYLE"){
m.remove();
}
},1000);
}
else if(duomi == domain || meiju == domain){
setInterval(function(){
for(var i in doc["duomi"]){
$(doc["duomi"][i]).remove();
}
},1000);
}
})();