Commit Graph

77 Commits

Author SHA1 Message Date
Florian Bruhin 88aa47c377 Add qt.workarounds.disable_accessibility setting
This disables accessibility with Qt 6.10.1, which
causes frequent segfaults.

Closes #8797
2025-11-30 17:54:33 +01:00
Florian Bruhin b3e4dba731 qtargs: Remove old workaround with Qt 6.10.1 2025-11-27 21:28:34 +01:00
Florian Bruhin 2b4e5757b0 Reenable accelerated 3D canvas on QtWebEngine 6.8.2+
Qt 6.8.2 has a more fine-grained workaround:
https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/606122

This never seems to have it made to Qt 6.9+, but I can't seem to reproduce the
issue anymore (neither with PDF.js nor with Google Sheets), even on older
affected Qt versions, even on older Intel hardware. Maybe something else (mesa
etc.?) changed and this was fixed there?

Let's reenable this and find out if it breaks things again for someone.

Fixes #8346
See #7489, #8001, #8006
2025-10-10 23:07:09 +02:00
Florian Bruhin 5e565f4dc7 Fix PermissionElement tests 2025-06-16 22:27:55 +02:00
Florian Bruhin ef2ceccd29 Qt 6.9: Work around QtWebEngine not handling <permission> element
See #8539
2025-04-07 21:58:45 +02:00
Florian Bruhin d272804126 Disable DocumentPictureInPicture API
The DocumentPictureInPicture JS API added in Chromium 116 is not implemented in
QtWebEngine. This results in createWindow() being called with a window type with
random value, which then causes qutebrowser to bail out:

    Traceback (most recent call last):
    File ".../qutebrowser/browser/webengine/webview.py", line 123, in createWindow
        raise ValueError("Invalid wintype {}".format(debug_type))
    ValueError: Invalid wintype 843995690

Until this is fixed in Qt, we pass an argument to Chromium to disable the API
entirely, so that web pages hopefully fall back to something else.

In the case of the new Google Huddle feature, this results in them still working
with an on-page overlay instead.

Thanks to Joshua Cold and Vivia for helping to debug this!

Fixes #8449
See https://bugreports.qt.io/browse/QTBUG-132681
2025-01-09 11:51:45 +01:00
Florian Bruhin b40e1861c3 Fix lint and tests 2023-12-04 19:55:06 +01:00
Florian Bruhin 21c7699eac Add content.javascript.legacy_touch_events setting
Closes #7814
2023-12-04 16:44:56 +01:00
toofar 75c78cadc4 Always disable accelerated canvas if set to auto on Qt6
We thought #7489 would be fixed on chrome 112 but it appears to still be
an issue. As discussed on the issue, it's not clear how many workflows
would be affected by accelerated 2d canvas and we don't have enough data
to detect the affected graphics configurations. So lets just disable
accelerated 2d canvas by default and users who want it turned on can do
so via the setting.

If some major use case pops up to enable this by default where possible
we can revisit and think of more nuanced feature detection.

I've kept the handling of callable values of `_WEBENGINE_SETTINGS`
because I don't like have to have something like
`--disable-accelerated-2d-canvas` written in code twice. The setting
above this one could probably be changed to use it too.
2023-12-02 12:53:44 +13:00
toofar fde4dd8434 Put qt.arg test back to being exact match
I previously changed the assertion to be a subset match, to deal with a qt arg
being added based on the Qt version the tests were being run on. I didn't
notice this fixture that can set setting to avoid that dynamic-ness instead.
2023-09-25 19:06:03 +13:00
toofar 2e961080a8 Make accelerated 2d canvas setting tristate with auto
I would like to be able to disable this workound for new enough chromium
versions (we still need to test that chrome 111 will be fixed, but we
can always bump it up later).

I also wanted to use the declarative mapping `_WEBENGINE_SETTINGS` instead
of adding a new conditional in `_qtwebengine_args`, because that just
seems nicer.

So I changed `_WEBENGINE_SETTINGS` so that the value could also be a
function. The idea is that the function returns on of the other values
based on some feature detection. This also required passing down the
args being used for feature detection in the calling method already.

I feel like that dict is being a bit abused here and if the entries
could be turned into objects with a bit more consistency it might be
nice. But this isn't too bad, right?

Had to change the `test_qt_args` test to be a superset test instead of
exact match because the new `--disable-accelerated-2d-canvas` arg was
showing up in the results based on whatever Qt version you happen to be
running the tests on.
2023-09-23 19:29:45 +12:00
Florian Bruhin 0718b25796 reuse: Initial copyright text update for myself
git ls-files | \
    xargs sed -Ei 's/Copyright [0-9]{4}(-[0-9]{4}) Florian Bruhin \(The Compiler\) <mail@qutebrowser\.org>/SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>/'
2023-07-23 12:49:05 +02:00
Florian Bruhin 77ca342cff reuse: Remove some more old license headers
git ls-files | \
xargs grep -l "This file is part of qutebrowser" | \
xargs grep -l SPDX-License-Identifier | \
xargs sed -i '/# This file is part of qutebrowser\./,/along with qutebrowser\.  If not, see <https:\/\/www\.gnu.org\/licenses\/>./d'
2023-07-23 12:15:03 +02:00
Florian Bruhin b2aaba6043 reuse: Adjust most license headers
git ls-files | xargs grep -l "is free software"  | xargs reuse annotate --license="GPL-3.0-or-later" --skip-unrecognised
2023-07-23 12:11:07 +02:00
Florian Bruhin 8dd5ba0abe Fix test_qtargs on Qt 5 2023-06-30 15:59:08 +02:00
Florian Bruhin 8e024ee654
Merge pull request #7761 from pylbrecht/remove-vim-modelines
Remove vim modelines in favor of .editorconfig
2023-06-30 15:51:19 +02:00
Florian Bruhin 693b25efd2 Add experimental_web_platform_features setting
Closes #7639
2023-06-30 15:32:46 +02:00
Philipp Albrecht d9e8b638bf Remove vim modelines
We're deprecating vim modelines in favor of `.editorconfig`.

Removing vim modelines could be done using two one-liners. Most of the vim modelines
were followed by an empty line, so this one-liner took care of these ones:

```sh
rg '^# vim: .+\n\n' -l | xargs sed -i '/^# vim: /,+1d'
```

Then some of the vim modelines were followed by a pylint configuration line, so running
this one-liner afterwards took care of that:

```sh
rg '^# vim:' -l | xargs sed -i '/^# vim: /d'
```
2023-06-30 11:03:06 +02:00
Florian Bruhin 34db7a1ef4 Qt 6.4: Add --webEngineArgs
See #7314
2022-08-23 18:31:42 +02:00
Florian Bruhin 21d9c9a585 lint: Fix various small flake8 issues 2022-08-23 18:31:41 +02:00
Florian Bruhin 80961cee6b lint: Fix flake8 whitespace issues 2022-08-23 18:31:41 +02:00
Florian Bruhin e658ce6acf lint: Remove unused imports
Via autoflake and git add -p
2022-08-23 18:31:41 +02:00
Florian Bruhin 81a67a9201 Adjust referrer handling for Qt 6
As suspected in a comment, ReducedReferrerGranularity does not exist anymore
with Chromium 90, and neither does an option for getting the full referrer back:

https://chromium-review.googlesource.com/c/chromium/src/+/2545444
https://bugs.chromium.org/p/chromium/issues/detail?id=1150018
2022-08-23 18:31:41 +02:00
Florian Bruhin ae910113a7 tests: Validate some places with declarative stringly-typed settings 2022-08-23 18:31:41 +02:00
Florian Bruhin c5a51eb0bc Drop Qt < 5.15
Fixes #7091

TODO: Add changelog
2022-08-23 18:31:41 +02:00
Florian Bruhin d387b1a108 tests: Adjust most imports 2022-08-23 18:31:40 +02:00
Florian Bruhin 8fe1de2fdc Add qt.chromium.sandboxing setting and sandboxing test 2022-03-03 21:16:04 +01:00
Florian Bruhin 38acd8f44a Rename Chromium settings 2022-03-03 13:49:41 +01:00
Florian Bruhin f4714a9300 Use flake8-pytest-style 2022-01-04 10:30:24 +01:00
Florian Bruhin 56bd87f0a6 Fix test_no_webengine_vailable 2021-03-18 11:31:55 +01:00
Florian Bruhin 4ba0ec591a Fix test_locale_workaround 2021-03-17 20:37:34 +01:00
Florian Bruhin 567ff75ca9 Fix Qt version for test_media_keys 2021-03-17 18:46:14 +01:00
Florian Bruhin 3d06fca8a6 Only run test_locale_workaround on Linux
Regressed in d56e01118c - needs to access
the qtwebengine_locales dir which is probably in another location on
non-Linux (especially macOS).
2021-03-17 18:45:24 +01:00
Florian Bruhin 07687ef24c Add missing test for HardwareMediaKeyHandling 2021-03-17 17:36:52 +01:00
Florian Bruhin d56e01118c Simplify patching in test_qtargs.py 2021-03-17 17:34:23 +01:00
Florian Bruhin 27fcfcdbd2 Fix issues with locale workaround 2021-03-10 20:51:27 +01:00
Lembrun 0a453396c1 Rename utils.py to testutils.py 2021-02-25 21:28:56 +01:00
Florian Bruhin 2108941543 Avoid calling versions.webengine_versions() without QtWebEngine
Alternatively, it would have been possible to move the backend library
checking from backendproblem.py to earlyinit.py entirely. However, this
would lead to less user-friendly dialogs, as we can't e.g. offer a
button to switch the backend setting.

Fixes #6161
2021-02-15 13:54:16 +01:00
Florian Bruhin c441c9becc Improve some qtargs unit tests 2021-02-11 16:15:50 +01:00
Florian Bruhin 94967ee979 Improve QtWebEngine version checking in qtargs.py
We now use versions.webengine_versions() to get the real QtWebEngine
version. This is more accurate and also allows us to drop the
InstalledApp workaround with QtWebEngine 5.15.3.

Also, we pass a WebEngineVersions object around instead of asking for
the versions multiple times. This also leads to less patching in tests.

See #3785
2021-02-11 16:06:15 +01:00
Florian Bruhin 9eabd09645 darkmode: Improve/fix various tests 2021-02-11 15:25:16 +01:00
Florian Bruhin f50a43d716 Change colors.webpage.prefers_color_scheme_dark to colors.webpage.preferred_color_scheme
See #6097
2021-02-11 14:18:30 +01:00
Florian Bruhin a88a9bab86 darkmode: Improve tests 2021-02-11 14:18:30 +01:00
Florian Bruhin 8d94a33b0a Improve tests in various corner cases 2021-02-10 16:13:22 +01:00
Florian Bruhin 38fec3726f Add a warning if QTWEBENGINE_CHROMIUM_FLAGS is set
See #6065
2021-01-28 15:56:14 +01:00
Florian Bruhin 1a4fff1a42 doc: Switch URLs to https 2021-01-26 15:19:01 +01:00
Florian Bruhin 222f1f19a1 Bump copyright years
Closes #6015
2021-01-20 20:06:19 +01:00
Florian Bruhin 94d42013f6 Fix installedapp workaround test on WebKit 2021-01-16 23:14:07 +01:00
Florian Bruhin 53859b68e5 Work around InstalledApp renderer process crash
Closes #5997
2021-01-16 20:54:14 +01:00
Florian Bruhin 36ade4bba5 qtargs: Add support for disabled features
Preparation for #5997
2021-01-16 20:54:03 +01:00