简体   繁体   中英

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.

You can try this:

webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM