-2

How to disable all ads like popups banner in webView for any URL.

I am using WKContentRuleListStore for block ads

I have use this json content block rule https://github.com/ShingoFukuyama/AdsBlock_WKWebView_for_iOS11/blob/master/AdsBlockWKWebView/adaway.json

All block rule assigning to listStore but it's not block all ads. It block some of the ads that mentioned in the json rule want to block all.

WKContentRuleListStore.default().lookUpContentRuleList(forIdentifier: ruleId1) { [weak self] (contentRuleList, error) in
}

I want to complete block ads on webView. Any help, suggestion appreciate.

Yogesh Patel
  • 1,893
  • 1
  • 20
  • 55
  • Are you sure the content blocker includes all ads that must be blocked? Have you tried [these lists](https://github.com/brave/adblock-lists)? –  Apr 12 '23 at 19:45
  • Yes, want to block all ads. How I can use I haven't found any Json file – Yogesh Patel Apr 12 '23 at 19:50
  • It is not possible to completely disable all ads on a UIWebView or WKWebView in iOS using only code. However, you can use third-party libraries or frameworks that allow you to block ads – Shahriar Hossain Apr 25 '23 at 15:40
  • can you please suggest to me any good third-party framework? I have checked ABPKit and other libraries but it is not working for me! – Yogesh Patel Apr 25 '23 at 15:43

1 Answers1

1

To populate your content-blocking JSON file, you can check out several sources like EasyList, Adguard's filters or Brave lists (as suggested by @Mr Developer).

There's also this utility that can help you generate Webkit block lists - abp2blocklist

HangarRash
  • 7,314
  • 5
  • 5
  • 32
Grimlock
  • 1,033
  • 1
  • 9
  • 23