Disable certificate workaround on Qt >= 5.9

Fixes #4020
This commit is contained in:
Florian Bruhin 2018-06-25 20:35:48 +02:00
parent 3f923b41e0
commit 8a4bba11ed
2 changed files with 9 additions and 4 deletions

View File

@ -104,6 +104,8 @@ Changed
Existing dictionaries are copied over.
- If an error while parsing `~/.netrc` occurs, the cause of the error is now
logged.
- On Qt 5.9 or newer, certificate errors now show Chromium's detailed error
page.
Fixed
~~~~~

View File

@ -199,15 +199,18 @@ class WebEnginePage(QWebEnginePage):
"{}".format(error))
ignore = False
log.webview.debug("ignore {}, URL {}, requested {}".format(
ignore, url, self.requestedUrl()))
# WORKAROUND for https://bugreports.qt.io/browse/QTBUG-56207
# We can't really know when to show an error page, as the error might
# have happened when loading some resource.
# However, self.url() is not available yet and self.requestedUrl()
# might not match the URL we get from the error - so we just apply a
# heuristic here.
# See https://bugreports.qt.io/browse/QTBUG-56207
log.webview.debug("ignore {}, URL {}, requested {}".format(
ignore, url, self.requestedUrl()))
if not ignore and url.matches(self.requestedUrl(), QUrl.RemoveScheme):
if (not qtutils.version_check('5.9') and
not ignore and
url.matches(self.requestedUrl(), QUrl.RemoveScheme)):
self.setHtml(error_page)
return ignore