Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
davide13
Posts: 312
Registered: ‎03-13-2013
My Device: Z10

ad block in a webview

sometimes when my wevbview was open an ad video opens in the webview, how can I block it?

thanks :smileyhappy:

If this post is helpful, please click the "like" button! :smileyhappy:
Developer
davide13
Posts: 312
Registered: ‎03-13-2013
My Device: Z10

Re: ad block in a webview

Nobody knows how to block ad pop-up in a webview?

If this post is helpful, please click the "like" button! :smileyhappy:
Developer
BBSJdev
Posts: 6,118
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: ad block in a webview

What have you tried so far?

 

Can you send me a link with a pop-up and if I get time today I'll see if I can come up with anything?


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Developer
davide13
Posts: 312
Registered: ‎03-13-2013
My Device: Z10

Re: ad block in a webview

I try onNavigationRequested but I din't resolve nothing, then I try onUrlChanged but with that the WebView didn't open. Sorry but I can't post the link because is not permitted in this community.

 

Thank you so much

If this post is helpful, please click the "like" button! :smileyhappy:
Developer
slashkyle
Posts: 820
Registered: ‎10-16-2012
My Device: Red Z10

Re: ad block in a webview

You could try posting a link to a pg related site that does something similar...

 

like projectfreetv

http://www.free-tv-video-online.me/internet/the_walking_dead/

(opening & clicking a video will ensure you get a few adds to pop up)

Developer
JoeQXS
Posts: 18
Registered: ‎02-13-2014
My Device: Z10 STL-003

Re: ad block in a webview

I would kill it by injecting JavaScript to erase the ad element.

 

Something along the lines of:

 

WebView {
                url: ""
                onLoadingChanged: {
                    evaluateJavaScript("document.getElementById('id-of-ad').innerHTML = '';");
                }
            }

 A downside to this is that you need to know how the site your accessing labels its ads.

Developer
BBSJdev
Posts: 6,118
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: ad block in a webview

@JoeQXS My guess is he's looking for something more generic but a good post, cheers.

If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Developer
davide13
Posts: 312
Registered: ‎03-13-2013
My Device: Z10

Re: ad block in a webview

Yes, the problem it's that says BBSJdev, I want some more general but I think it's a very interesting piece of code :smileywink:

Thank you anyway :smileyhappy:

If this post is helpful, please click the "like" button! :smileyhappy: