在我的内容拦截器中,有没有办法阻止某个网站上的广告拦截?例如,如果我想屏蔽除 The Verge 之外的所有网站上的广告,有没有办法防止我提供的屏蔽规则影响此页面?
问问题
1407 次
3 回答
6
不幸的是,上面的答案是不正确的,原因有两个,触发器中需要 url-filter 属性,并且 if-domain 属性必须是域数组,而不是单个值。经过大量试验和错误后,我找到了将网站列入白名单的可行解决方案。
{
"trigger": {
"url-filter": ".*",
"if-domain": ["the verge.com"]
},
"action": {
"type": "ignore-previous-rules"
}
}
我能够使用上述答案找到导致各种错误的唯一文档是在此处搜索源代码:https ://github.com/WebKit/webkit/tree/67985c34ffc405f69995e8a35f9c38618625c403/Source/WebCore/contentextensions
于 2015-12-09T21:19:31.620 回答
1
我想你会做这样的事情。
"action": {
"type": “ignore-previous-rules”
},
"trigger": {
“if-domain”: “theverge.com”
}
一些很好的链接可以查看。
于 2015-10-07T23:41:24.973 回答
1
本文讲述解决方案http://comments.gmane.org/gmane.os.opendarwin.webkit.user/3971
{
"action": {
"type": "ignore-previous-rules"
},
"trigger": {
"url-filter": ".*",
"if-domain": ["*apple.com"]
}
}
于 2015-12-11T04:11:07.317 回答