[PyQt] QWebPage don't execute javascript anymore

Florian Bruhin me at the-compiler.org
Thu May 25 22:46:56 BST 2017


Hi,

On Thu, May 25, 2017 at 02:39:31PM +0200, Vincent Vande Vyvre wrote:
> Is it a change known into QWebPage with javascript content ?

No - but subclassing QWebPage in your example and implementing
javaScriptConsoleMessage shows:

    Cross-origin image load denied by Cross-Origin Resource Sharing policy.

Doing this in your code makes it work:

    self.settings().setAttribute(QWebSettings.LocalContentCanAccessRemoteUrls, True)

> Note: I can't change my code for QtWebEngineView.QWebEnginePage because
> QtWebEngineView is not provided for Debian/Ubuntu.

It is for Debian Stretch and Ubuntu 17.04:

https://packages.debian.org/stretch/libqt5webengine5
https://packages.ubuntu.com/zesty/libqt5webengine5

There are also unofficial packages for the QtWebKit successor:

https://github.com/annulen/webkit/wiki
http://repo.paretje.be/unstable/

Florian

-- 
https://www.qutebrowser.org  | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072  | https://the-compiler.org/pubkey.asc
         I love long mails!  | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170525/62810f95/attachment.sig>


More information about the PyQt mailing list