Description
With this code, the script is never run:
#include <QApplication> #include <QWebEngineView> #include <QWebEngineScript> #include <QWebEngineScriptCollection> #include <QUrl> int main(int argc, char *argv[]) { QApplication app(argc, argv); QWebEngineView view; QWebEngineScript script; script.setInjectionPoint(QWebEngineScript::DocumentCreation); // script.setInjectionPoint(QWebEngineScript::DocumentReady); script.setSourceCode("console.log('Hello World!');"); view.page()->scripts().insert(script); view.load(QUrl("view-source:https://qutebrowser.org")); view.show(); return app.exec(); }
When using DocumentReady instead of DocumentCreation, it runs fine though.
Attachments
For Gerrit Dashboard: QTBUG-66011 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
226763,7 | Run scripts from DidClearWindowObject | dev | qt/qtwebengine | Status: MERGED | -2 | 0 |