Add some debug logging for GreaseMonkey with QtWebKit

This commit is contained in:
Florian Bruhin 2017-11-20 07:31:01 +01:00 committed by Jimmy
parent df624944f9
commit 6933bc05b4

View File

@ -96,6 +96,8 @@ class BrowserPage(QWebPage):
Connect the signals used as triggers for injecting user
javascripts into the passed QWebFrame.
"""
log.greasemonkey.debug("Connecting to frame {} ({})"
.format(frame, frame.url().toDisplayString()))
frame.loadFinished.connect(
functools.partial(self.inject_userjs, frame))
@ -306,6 +308,9 @@ class BrowserPage(QWebPage):
if url.isEmpty():
url = frame.requestedUrl()
log.greasemonkey.debug("inject_userjs called for {} ({})"
.format(frame, url.toDisplayString()))
greasemonkey = objreg.get('greasemonkey')
scripts = greasemonkey.scripts_for(url)
# QtWebKit has trouble providing us with signals representing