Revert "Insert qutebrowser scripts on DocumentCreation and DocumentReady"
This reverts commit fac0f66e52
.
This commit is contained in:
parent
84bae210ab
commit
5c73910a33
@ -640,21 +640,17 @@ class WebEngineTab(browsertab.AbstractTab):
|
|||||||
utils.read_file('javascript/webelem.js'),
|
utils.read_file('javascript/webelem.js'),
|
||||||
utils.read_file('javascript/caret.js'),
|
utils.read_file('javascript/caret.js'),
|
||||||
])
|
])
|
||||||
scripts = self._widget.page().scripts()
|
|
||||||
|
|
||||||
script = QWebEngineScript()
|
script = QWebEngineScript()
|
||||||
script.setInjectionPoint(QWebEngineScript.DocumentCreation)
|
# We can't use DocumentCreation here as WORKAROUND for
|
||||||
|
# https://bugreports.qt.io/browse/QTBUG-66011
|
||||||
|
script.setInjectionPoint(QWebEngineScript.DocumentReady)
|
||||||
script.setSourceCode(js_code)
|
script.setSourceCode(js_code)
|
||||||
script.setWorldId(QWebEngineScript.ApplicationWorld)
|
|
||||||
# FIXME:qtwebengine what about runsOnSubFrames?
|
|
||||||
scripts.insert(script)
|
|
||||||
|
|
||||||
# WORKAROUND for https://bugreports.qt.io/browse/QTBUG-66011
|
page = self._widget.page()
|
||||||
script2 = QWebEngineScript()
|
script.setWorldId(QWebEngineScript.ApplicationWorld)
|
||||||
script2.setInjectionPoint(QWebEngineScript.DocumentReady)
|
|
||||||
script2.setSourceCode(js_code)
|
# FIXME:qtwebengine what about runsOnSubFrames?
|
||||||
script2.setWorldId(QWebEngineScript.ApplicationWorld)
|
page.scripts().insert(script)
|
||||||
scripts.insert(script2)
|
|
||||||
|
|
||||||
def _install_event_filter(self):
|
def _install_event_filter(self):
|
||||||
self._widget.focusProxy().installEventFilter(self._mouse_event_filter)
|
self._widget.focusProxy().installEventFilter(self._mouse_event_filter)
|
||||||
|
Loading…
Reference in New Issue
Block a user