[Qt-interest] webkit - how to prevent alert popups

Tony Rietwyk tony.rietwyk at rightsoft.com.au
Fri Sep 17 08:35:29 CEST 2010


Hi Richard, 
 
You can override the protected method QWebPage.javaScriptAlert to do
nothing.  You would then use QWebView.setPage to replace the standard one
used by the view.  
 
Hope that helps, 
 
Tony.
 
 
 

-----Original Message-----
Sent: Friday, 17 September 2010 15:55


Hello,

I am trying to prevent alert popups in my webkit browser.

I thought the easiest way to do that would be to simply remove alert
statements in the HTML (not concerned about external JS for now).
How can I modify the downloaded HTML before it is rendered?

When the QWebView::loadFinished signal is emitted the page already contains
the new content. 
Is there a relevant method in QNetworkAccessManager I can intercept?

Or some other more robust approach?

thanks,
Richard

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100917/9ec29fba/attachment.html 


More information about the Qt-interest-old mailing list