Suppress JavaScript popup in QWebView



  • Hi everyone,

    I've got an application running on a system with no keyboard or mouse interface. When loading certain web pages with a QWebView, I get a JavaScript popup:

    "The script on this page appears to have a problem. Do you want to stop the script?"

    I want to stop the popup message from happening.

    I've tried subclassing QWebPage and implementing javaScriptAlert, javaScriptConfirm, and javaScriptPrompt, but it appears that none of those functions are getting called. I used setPage() to set the QWebView's page to my custom class.

    Does anyone know what I can do to stop the popup?

    Thanks!

    Marlon



  • After more searching, I found this thread: http://qt-project.org/forums/viewthread/21912

    Implementing QWebPage::shouldInterruptJavaScript() solved my problem.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.