Log is_main_frame in acceptNavigationRequest

This commit is contained in:
Florian Bruhin 2016-08-11 16:36:41 +02:00
parent 421b14681f
commit ad1e1e5f92

View File

@ -82,7 +82,7 @@ class WebEnginePage(QWebEnginePage):
def acceptNavigationRequest(self, def acceptNavigationRequest(self,
url: QUrl, url: QUrl,
typ: QWebEnginePage.NavigationType, typ: QWebEnginePage.NavigationType,
_is_main_frame: bool): is_main_frame: bool):
"""Override acceptNavigationRequest to handle clicked links. """Override acceptNavigationRequest to handle clicked links.
Setting linkDelegationPolicy to DelegateAllLinks and using a slot bound Setting linkDelegationPolicy to DelegateAllLinks and using a slot bound
@ -95,10 +95,10 @@ class WebEnginePage(QWebEnginePage):
""" """
target = self._tabdata.combined_target() target = self._tabdata.combined_target()
log.webview.debug("navigation request: url {}, type {}, " log.webview.debug("navigation request: url {}, type {}, "
"target {}".format( "target {}, is_main_frame {}".format(
url.toDisplayString(), url.toDisplayString(),
debug.qenum_key(QWebEnginePage, typ), debug.qenum_key(QWebEnginePage, typ),
target)) target, is_main_frame))
if typ != QWebEnginePage.NavigationTypeLinkClicked: if typ != QWebEnginePage.NavigationTypeLinkClicked:
return True return True