summaryrefslogtreecommitdiff
path: root/qutebrowser/browser/webengine/webengineelem.py
diff options
context:
space:
mode:
Diffstat (limited to 'qutebrowser/browser/webengine/webengineelem.py')
-rw-r--r--qutebrowser/browser/webengine/webengineelem.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/qutebrowser/browser/webengine/webengineelem.py b/qutebrowser/browser/webengine/webengineelem.py
index 7e5da7b8b..c387ebbcf 100644
--- a/qutebrowser/browser/webengine/webengineelem.py
+++ b/qutebrowser/browser/webengine/webengineelem.py
@@ -1,19 +1,6 @@
-# Copyright 2016-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
+# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
-# This file is part of qutebrowser.
-#
-# qutebrowser is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# qutebrowser is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with qutebrowser. If not, see <https://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: GPL-3.0-or-later
"""QtWebEngine specific part of the web element API."""
@@ -24,7 +11,7 @@ from qutebrowser.qt.core import QRect, QEventLoop
from qutebrowser.qt.widgets import QApplication
from qutebrowser.qt.webenginecore import QWebEngineSettings
-from qutebrowser.utils import log, javascript, urlutils, usertypes, utils
+from qutebrowser.utils import log, javascript, urlutils, usertypes, utils, version
from qutebrowser.browser import webelem
if TYPE_CHECKING:
@@ -226,6 +213,19 @@ class WebEngineElement(webelem.AbstractWebElement):
return True
if baseurl.scheme() == url.scheme(): # e.g. a qute:// link
return False
+
+ # Qt 6.3+ needs a user interaction to allow navigations from qute:// to
+ # outside qute:// (like e.g. on qute://bookmarks), as well as from file:// to
+ # outside of file:// (e.g. users having a local bookmarks.html).
+ versions = version.qtwebengine_versions()
+ for scheme in ["qute", "file"]:
+ if (
+ baseurl.scheme() == scheme and
+ url.scheme() != scheme and
+ versions.webengine >= utils.VersionNumber(6, 3)
+ ):
+ return True
+
return url.scheme() not in urlutils.WEBENGINE_SCHEMES
def _click_editable(self, click_target: usertypes.ClickTarget) -> None: