diff --git a/qutebrowser/browser/webengine/webenginequtescheme.py b/qutebrowser/browser/webengine/webenginequtescheme.py index ac583a671..80269ba85 100644 --- a/qutebrowser/browser/webengine/webenginequtescheme.py +++ b/qutebrowser/browser/webengine/webenginequtescheme.py @@ -19,7 +19,7 @@ """QtWebEngine specific qute://* handlers and glue code.""" -from PyQt5.QtCore import QBuffer, QIODevice +from PyQt5.QtCore import QBuffer, QIODevice, QUrl from PyQt5.QtWebEngineCore import (QWebEngineUrlSchemeHandler, QWebEngineUrlRequestJob) @@ -34,6 +34,9 @@ class QuteSchemeHandler(QWebEngineUrlSchemeHandler): def install(self, profile): """Install the handler for qute:// URLs on the given profile.""" profile.installUrlSchemeHandler(b'qute', self) + if qtutils.version_check('5.11', compiled=False): + # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-63378 + profile.installUrlSchemeHandler(b'chrome-error', self) def requestStarted(self, job): """Handle a request for a qute: scheme. @@ -45,6 +48,12 @@ class QuteSchemeHandler(QWebEngineUrlSchemeHandler): job: QWebEngineUrlRequestJob """ url = job.requestUrl() + + if url.scheme() == 'chrome-error': + # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-63378 + job.fail(QWebEngineUrlRequestJob.UrlInvalid) + return + assert job.requestMethod() == b'GET' assert url.scheme() == 'qute' log.misc.debug("Got request for {}".format(url.toDisplayString())) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index fa2edf53e..6a60cdce0 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -1030,12 +1030,6 @@ class WebEngineTab(browsertab.AbstractTab): if not ok and not js_enabled: self.dump_async(self._error_page_workaround) - if (not ok and - self.url() == QUrl('chrome-error://chromewebdata/') and - qtutils.version_check('5.11', compiled=False)): - # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-63378 - self._show_error_page(QUrl(), "Unknown URL scheme") - if ok and self._reload_url is not None: # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-66656 log.config.debug(