Skip to content

Commit

Permalink
Tentative fix for qutebrowser#5078
Browse files Browse the repository at this point in the history
  • Loading branch information
lufte committed Oct 19, 2019
1 parent 7eee698 commit 789fcb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions qutebrowser/browser/browsertab.py
Expand Up @@ -865,6 +865,7 @@ class AbstractTab(QWidget):
# arg 0: A TerminationStatus member.
# arg 1: The exit code.
renderer_process_terminated = pyqtSignal(TerminationStatus, int)
last_navigation = None

def __init__(self, *, win_id: int, private: bool,
parent: QWidget = None) -> None:
Expand Down Expand Up @@ -981,6 +982,8 @@ def _on_navigation_request(
navigation: usertypes.NavigationRequest
) -> None:
"""Handle common acceptNavigationRequest code."""
if navigation.is_main_frame:
self.last_navigation = navigation
url = utils.elide(navigation.url.toDisplayString(), 100)
log.webview.debug("navigation request: url {}, type {}, is_main_frame "
"{}".format(url,
Expand Down
5 changes: 2 additions & 3 deletions qutebrowser/browser/webengine/webenginetab.py
Expand Up @@ -1429,9 +1429,8 @@ def _on_ssl_errors(self, error):
# However, self.url() is not available yet and the requested URL
# might not match the URL we get from the error - so we just apply a
# heuristic here.
if (not qtutils.version_check('5.9') and
not error.ignore and
url.matches(self.url(requested=True), QUrl.RemoveScheme)):
if (not error.ignore and
url.matches(self.last_navigation.url, QUrl.RemoveScheme)):
self._show_error_page(url, str(error))

@pyqtSlot(QUrl)
Expand Down

0 comments on commit 789fcb0

Please sign in to comment.