Skip to content

Commit

Permalink
Drop old Debian error page workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Compiler authored and crides committed Sep 19, 2022
1 parent 734f717 commit 0f6fc2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
3 changes: 3 additions & 0 deletions doc/changelog.asciidoc
Expand Up @@ -72,6 +72,9 @@ Fixed
with `confirm_quit` and multiple windows remain.
- Crash when a previous crash-log file contains non-ASCII characters (which
should never happen unless it was edited manually)
- Due to changes in Debian, an old workaround (for broken QtWebEngine patching
on Debian) caused the inferior qutebrowser error page to be displayed, when
Chromium's would have worked fine. The workaround was now dropped.
[[v2.4.1]]
v2.4.1 (unreleased)
Expand Down
17 changes: 5 additions & 12 deletions qutebrowser/browser/webengine/webenginetab.py
Expand Up @@ -1522,27 +1522,21 @@ def _on_render_process_terminated(self, status, exitcode):
}
self.renderer_process_terminated.emit(status_map[status], exitcode)

def _error_page_workaround(self, js_enabled, html):
def _error_page_workaround(self, html):
"""Check if we're displaying a Chromium error page.
This gets called if we got a loadFinished(False), so we can display at
least some error page in situations where Chromium's can't be
This gets called if we got a loadFinished(False) without JavaScript, so
we can display at least some error page, since Chromium's can't be
displayed.
WORKAROUND for https://bugreports.qt.io/browse/QTBUG-66643
WORKAROUND for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=882805
"""
match = re.search(r'"errorCode":"([^"]*)"', html)
if match is None:
return

error = match.group(1)
log.webview.error("Load error: {}".format(error))

missing_jst = 'jstProcess(' in html and 'jstProcess=' not in html
if js_enabled and not missing_jst:
return

self._show_error_page(self.url(), error=error)

@pyqtSlot(int)
Expand All @@ -1565,9 +1559,8 @@ def _on_load_finished(self, ok: bool) -> None:
# WORKAROUND for https://bugreports.qt.io/browse/QTBUG-65223
self._update_load_status(ok)

self.dump_async(functools.partial(
self._error_page_workaround,
self.settings.test_attribute('content.javascript.enabled')))
if not self.settings.test_attribute('content.javascript.enabled'):
self.dump_async(self._error_page_workaround)

@pyqtSlot(certificateerror.CertificateErrorWrapper)
def _on_ssl_errors(self, error):
Expand Down

0 comments on commit 0f6fc2b

Please sign in to comment.