alchemist
alchemist

Reputation: 1081

How can i block popups [ads] from appearing in my webview?

I am creating a webview which loads some sites. I want to block popups appearing on the site, so that only legitimate Urls are seen by users. How can i achieve that ?? Browsers do detect popups and warns users about Blocking it or allowing it. So i assume that there must be a way to detect popups.

Thanks in advance.

Upvotes: 1

Views: 1057

Answers (1)

c1ph4
c1ph4

Reputation: 141

You can try this:

webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);

But at least for me not all popups are blocked and I can not explain why.

Upvotes: 1

Related Questions