提问人:Yogesh Patel 提问时间:4/13/2023 更新时间:4/27/2023 访问量:504
如何禁用 webView swift 上的所有广告
How to disable all ads on webView swift
问:
如何禁用任何 URL 的 webView 中的所有广告,例如弹出窗口横幅。
我用于屏蔽广告WKContentRuleListStore
我已经使用了这个json内容阻止规则 https://github.com/ShingoFukuyama/AdsBlock_WKWebView_for_iOS11/blob/master/AdsBlockWKWebView/adaway.json
所有屏蔽规则都分配给 listStore,但它不是屏蔽所有广告。它阻止了 json 规则中提到的一些广告想要阻止所有广告。
WKContentRuleListStore.default().lookUpContentRuleList(forIdentifier: ruleId1) { [weak self] (contentRuleList, error) in
}
我想在 webView 上完成屏蔽广告。任何帮助,建议不胜感激。
答:
1赞
Grimlock
4/27/2023
#1
要填充内容阻塞的 JSON 文件,您可以查看多个来源,例如 EasyList、Adguard 的过滤器或 Brave 列表(根据 @Mr Developer 的建议)。
还有一个实用程序可以帮助您生成 Webkit 阻止列表 - abp2blocklist
上一个:细分和广告拦截器
评论