diff options
author | Florian Bruhin <me@the-compiler.org> | 2023-06-30 15:32:46 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2023-06-30 15:32:46 +0200 |
commit | 693b25efd26d325a06ca8db516292b14094e7cbc (patch) | |
tree | 1490cdc5200ab7b17cae456b12d3b565dac08f55 | |
parent | 7b630361789e6edfdaa0496af650db6521d37187 (diff) | |
download | qutebrowser-693b25efd26d325a06ca8db516292b14094e7cbc.tar.gz qutebrowser-693b25efd26d325a06ca8db516292b14094e7cbc.zip |
Add experimental_web_platform_features setting
Closes #7639
-rw-r--r-- | doc/changelog.asciidoc | 3 | ||||
-rw-r--r-- | doc/help/settings.asciidoc | 20 | ||||
-rw-r--r-- | qutebrowser/config/configdata.yml | 17 | ||||
-rw-r--r-- | qutebrowser/config/qtargs.py | 9 | ||||
-rw-r--r-- | tests/unit/config/test_qtargs.py | 15 |
5 files changed, 63 insertions, 1 deletions
diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index d512e0dd4..ef5123d29 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -50,6 +50,9 @@ Added * `qutedmenu` gained new `window` and `private` options. * `qute-keepassxc` now supports unlock-on-demand, multiple account selection via rofi, and inserting TOTP-codes (experimental). +- New `qt.chromium.experimental_web_platform_features` setting, which is enabled + on Qt 5 by default, to maximize compatibility with websites despite an aging + Chromium backend. - New `colors.webpage.darkmode.increase_text_contrast` setting for Qt 6.3+ - New `fonts.tooltip`, `colors.tooltip.bg` and `colors.tooltip.fg` settings. - New `log-qt-events` debug flag for `-D` diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 34262b945..4a3a3c0e7 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -294,6 +294,7 @@ |<<prompt.filebrowser,prompt.filebrowser>>|Show a filebrowser in download prompts. |<<prompt.radius,prompt.radius>>|Rounding radius (in pixels) for the edges of prompts. |<<qt.args,qt.args>>|Additional arguments to pass to Qt, without leading `--`. +|<<qt.chromium.experimental_web_platform_features,qt.chromium.experimental_web_platform_features>>|Enables Web Platform features that are in development. |<<qt.chromium.low_end_device_mode,qt.chromium.low_end_device_mode>>|When to use Chromium's low-end device mode. |<<qt.chromium.process_model,qt.chromium.process_model>>|Which Chromium process model to use. |<<qt.chromium.sandboxing,qt.chromium.sandboxing>>|What sandboxing mechanisms in Chromium to use. @@ -3851,6 +3852,25 @@ Type: <<types,List of String>> Default: empty +[[qt.chromium.experimental_web_platform_features]] +=== qt.chromium.experimental_web_platform_features +Enables Web Platform features that are in development. +This passes the `--enable-experimental-web-platform-features` flag to Chromium. By default, this is enabled with Qt 5 to maximize compatibility despite an aging Chromium base. + +This setting requires a restart. + +This setting is only available with the QtWebEngine backend. + +Type: <<types,String>> + +Valid values: + + * +always+: Enable experimental web platform features. + * +auto+: Enable experimental web platform features when using Qt 5. + * +never+: Disable experimental web platform features. + +Default: +pass:[auto]+ + [[qt.chromium.low_end_device_mode]] === qt.chromium.low_end_device_mode When to use Chromium's low-end device mode. diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index bedcc2ade..8fbb67cb7 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -327,6 +327,23 @@ qt.chromium.sandboxing: - https://chromium.googlesource.com/chromium/src/\+/HEAD/docs/design/sandbox_faq.md[FAQ (Windows-centric)] # yamllint enable rule:line-length +qt.chromium.experimental_web_platform_features: + type: + name: String + valid_values: + - always: Enable experimental web platform features. + - auto: Enable experimental web platform features when using Qt 5. + - never: Disable experimental web platform features. + default: auto + backend: QtWebEngine + restart: true + desc: >- + Enables Web Platform features that are in development. + + This passes the `--enable-experimental-web-platform-features` flag to + Chromium. By default, this is enabled with Qt 5 to maximize compatibility + despite an aging Chromium base. + qt.highdpi: type: Bool default: false diff --git a/qutebrowser/config/qtargs.py b/qutebrowser/config/qtargs.py index 8b7a85b64..1dd60c2c2 100644 --- a/qutebrowser/config/qtargs.py +++ b/qutebrowser/config/qtargs.py @@ -25,6 +25,7 @@ import argparse import pathlib from typing import Any, Dict, Iterator, List, Optional, Sequence, Tuple +from qutebrowser.qt import machinery from qutebrowser.qt.core import QLocale from qutebrowser.config import config @@ -331,7 +332,13 @@ _WEBENGINE_SETTINGS: Dict[str, Dict[Any, Optional[str]]] = { 'enable-all': None, 'disable-seccomp-bpf': '--disable-seccomp-filter-sandbox', 'disable-all': '--no-sandbox', - } + }, + 'qt.chromium.experimental_web_platform_features': { + 'always': '--enable-experimental-web-platform-features', + 'never': None, + 'auto': + '--enable-experimental-web-platform-features' if machinery.IS_QT5 else None, + }, } diff --git a/tests/unit/config/test_qtargs.py b/tests/unit/config/test_qtargs.py index a65847929..91462338e 100644 --- a/tests/unit/config/test_qtargs.py +++ b/tests/unit/config/test_qtargs.py @@ -22,6 +22,7 @@ import logging import pytest +from qutebrowser.qt import machinery from qutebrowser import qutebrowser from qutebrowser.config import qtargs, configdata from qutebrowser.utils import usertypes, version @@ -488,6 +489,20 @@ class TestWebEngineArgs: args = qtargs.qt_args(parsed) assert '--lang=de' in args + @pytest.mark.parametrize('value, has_arg', [ + ('always', True), + ('auto', machinery.IS_QT5), + ('never', False), + ]) + def test_experimental_web_platform_features( + self, value, has_arg, parser, config_stub, + ): + config_stub.val.qt.chromium.experimental_web_platform_features = value + + parsed = parser.parse_args([]) + args = qtargs.qt_args(parsed) + assert ('--enable-experimental-web-platform-features' in args) == has_arg + @pytest.mark.parametrize("version, expected", [ ('5.15.2', False), ('5.15.9', False), |