summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2022-05-24 14:23:35 +0200
committerFlorian Bruhin <me@the-compiler.org>2022-06-22 17:41:12 +0200
commitc1505b68d2bfd792817e208b81041457263f25eb (patch)
tree0c9ee8f85b4e467c253aa580eda8b69333b5a9e8
parent7a0c2f49da851e5be4ef1e9c805f4a30380351cb (diff)
downloadqutebrowser-c1505b68d2bfd792817e208b81041457263f25eb.tar.gz
qutebrowser-c1505b68d2bfd792817e208b81041457263f25eb.zip
Workaround for clicking links in local URLs
Closes #7194
-rw-r--r--qutebrowser/browser/webengine/webenginetab.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py
index 5e6103ccc..37750e343 100644
--- a/qutebrowser/browser/webengine/webenginetab.py
+++ b/qutebrowser/browser/webengine/webenginetab.py
@@ -1611,6 +1611,26 @@ class WebEngineTab(browsertab.AbstractTab):
def _on_navigation_request(self, navigation):
super()._on_navigation_request(navigation)
+ local_schemes = {"qute", "file"}
+ qtwe_ver = version.qtwebengine_versions().webengine
+ if (
+ navigation.accepted and
+ self.url().scheme().lower() in local_schemes and
+ navigation.url.scheme().lower() not in local_schemes and
+ (navigation.navigation_type ==
+ usertypes.NavigationRequest.Type.link_clicked) and
+ navigation.is_main_frame and
+ (utils.VersionNumber(6, 2) <= qtwe_ver < utils.VersionNumber(6, 2, 5) or
+ utils.VersionNumber(6, 3) <= qtwe_ver < utils.VersionNumber(6, 3, 1))
+ ):
+ # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-103778
+ log.webview.debug(
+ "Working around blocked request from local page "
+ f"{self.url().toDisplayString()}"
+ )
+ navigation.accepted = False
+ self.load_url(navigation.url)
+
if not navigation.accepted or not navigation.is_main_frame:
return