diff options
author | toofar <toofar@spalge.com> | 2023-10-28 16:15:45 +1300 |
---|---|---|
committer | toofar <toofar@spalge.com> | 2023-10-28 16:15:45 +1300 |
commit | 25e0d02de4b2c397b9e97daeffb842f7d93e13c6 (patch) | |
tree | 547eb96f567e0cae39f5736fda8bc75fb57eeb41 | |
parent | 931b65330136f5400a021f07d73e9f38381db669 (diff) | |
download | qutebrowser-25e0d02de4b2c397b9e97daeffb842f7d93e13c6.tar.gz qutebrowser-25e0d02de4b2c397b9e97daeffb842f7d93e13c6.zip |
Only patch resources on 6.6.0
The only affected version is 6.6.0. I'm passing `avoid_init` because
this patching is done right before the user agent is parsed (which only
happens on Qt5).
It's been proposed that we don't need to do this patching for users
running on distros that backported the fix to their webengine. Which I
think means that we would only do the patching on our bundled installer
version for window and mac. But I'm not sure I agree with that. I would
rather not have had to re-compile the fix into my build, and I don't
know what other distributors position on backporting patches is either.
For example I'm on debian, if they had 6.6.0, would they have backported
this fix? It looks like they've only got build related patches on the
current version for example: https://sources.debian.org/patches/qt6-webengine/6.4.2-final+dfsg-12/
And there's the flatpak version etc.
Anyway, if we want to add that check in too I think it would look like:
if not hasattr(sys, 'frozen'):
# Assume if we aren't frozen we are running against a patched Qt
# version. So only apply this quirk in our bundled installers.
return
-rw-r--r-- | qutebrowser/misc/pakjoy.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/qutebrowser/misc/pakjoy.py b/qutebrowser/misc/pakjoy.py index 7e0d139c4..c2647c478 100644 --- a/qutebrowser/misc/pakjoy.py +++ b/qutebrowser/misc/pakjoy.py @@ -33,7 +33,7 @@ import dataclasses from typing import ClassVar, IO, Optional, Dict, Tuple from qutebrowser.misc import binparsing -from qutebrowser.utils import qtutils, standarddir +from qutebrowser.utils import qtutils, standarddir, version, utils HANGOUTS_MARKER = b"// Extension ID: nkeimhogjdpnpccoofpliimaahmaaome" HANGOUTS_ID = 36197 # as found by toofar @@ -144,6 +144,10 @@ class PakParser: def patch(): + versions = version.qtwebengine_versions(avoid_init=True) + if versions.webengine != utils.VersionNumber(6, 6): + return + resources_path = qtutils.library_path(qtutils.LibraryPath.data) / "resources" work_dir = pathlib.Path(standarddir.cache()) / "webengine_resources_pak_quirk" patched_file = work_dir / "qtwebengine_resources.pak" |