FireFox、Chrome油猴脚本:查杀浮动广告
2013-06-14 23:33
260 查看
// ==UserScript==
// @name jsKillAD
// @namespace jsKillAD
// @description 查杀页面浮动广告
// @description:en Kill AD on page
// @author xinggsf~gmail。com
// @homepageURL https://greasyfork.org/scripts/7410
// updateURL https://greasyfork.org/scripts/7410/code/jsKillAD.user.js
// @encoding utf-8
// @license GPL version 3
// @include http://*
// @include https://*
// @exclude http://*.mail.*/*
// @exclude http://*mimg.127.net/*
// @exclude http://*.csdn.net/postedit/*
// @exclude https://mail.google.com/*
// @exclude http://www.google.*/search?*
// @exclude https://www.google.*/search?*
// @exclude http://www.google.*/webhp*
// @exclude https://www.google.*/webhp*
// @exclude http://www.baidu.com/s?*
// @exclude http://play.baidu.com/*
// @exclude http://115.com/*
// @exclude http://*.115.com/*
// @exclude http://*.1ting.com/*
// @exclude http://www.360doc.com/*
// @exclude http://www.cnblogs.com/*
// @exclude http://www.iqiyi.com/v_*
// @exclude http://*.qq.com/*
// @exclude http://video.sina.com.cn/*
// @exclude http://www.yatu.tv/m*/play*.html
// @grant none
// @modified 2015.3.29
// @version 1.3.8
// ==/UserScript==
-function (doc) {
var bc = Array.prototype.forEach;
function getStyle(o, s) {
if (o.style[s]) return o.style[s];
if (doc.defaultView && doc.defaultView.getComputedStyle) {//DOM
var x = doc.defaultView.getComputedStyle(o, '');
//s = s.replace(/([A-Z])/g,'-$1').toLowerCase();
return x && x.getPropertyValue(s);
}
}
function testStyle(o) {
var s = getStyle(o, 'position');
return s === 'fixed' || s === 'absolute';
}
function isFloatLay(o) {
var x = o.offsetParent;
return !x || x.tagName === 'BODY' || x.tagName === 'HTML';
}
-function(el) {
['iframe','img','object','embed'].forEach(function (s) {
bc.call(el.getElementsByTagName(s), function (x) {
while (x) {
if (isFloatLay(x)) {
testStyle(x) && x.parentNode.removeChild(x);
break;
}
x = x.offsetParent;
}
});
});
}(doc);
}(document);
相关文章推荐
- FireFox、Chrome油猴脚本:查杀浮动广告。可参考置顶文章!
- 禁止Chrome加载电脑管家广告过滤脚本代码
- JS浮动广告脚本
- 兼容IE & Firefox 的脚本改本属性值的检测方法 [ 不支持Chrome ]
- Android上Chrome、Firefox和Opera广告过滤方法
- 网页HTML右侧浮动DIV层广告或在线客服图片框最佳代码(支持Firefox&IE)
- 浮动广告-兼容ie6,ie7,firefox2,3
- javascript小组件 原生table排序表格脚本(兼容ie firefox opera chrome)
- javascript 复制连接脚本(兼容ie 、火狐Firefox、Chrome)
- [记录]firefox繁体转换成简体的油猴脚本
- 自用chrome+油猴脚本,使用迅雷下载百度云大文件,一键离线下载
- 取缔Chrome装载电脑管家的广告过滤脚本代码
- 浮动对联广告 上下及水平窗口自适应浮动广告代码 兼容if,firefox
- 浮动广告的脚本
- javascript小组件 原生脚本排序table表格兼容ie firefox opera chrome 浏览器
- 兼容IE6+、Chrome、FireFox的固定浮动css代码
- 推广显示Tex公式的Firefox插件(油猴脚本),方便论坛和博客的公式交流
- 去除优酷土豆广告的油猴脚本
- IE 下脚本错Error: Object expected捉虫记.(Chrome&Firefox运行正常)
- javascript小组件 原生table排序表格脚本(兼容ie firefox opera chrome)