diff --git a/.github/workflows/bleeding.yml b/.github/workflows/bleeding.yml index ce4531b00..baafa1983 100644 --- a/.github/workflows/bleeding.yml +++ b/.github/workflows/bleeding.yml @@ -39,7 +39,7 @@ jobs: - name: Set up problem matchers run: "python scripts/dev/ci/problemmatchers.py py3 ${{ runner.temp }}" - name: Upgrade 3rd party assets - run: "tox exec -e ${{ matrix.testenv }} -- python scripts/dev/update_3rdparty.py --gh-token ${{ secrets.GITHUB_TOKEN }}" + run: "tox exec -e ${{ matrix.testenv }} -- python scripts/dev/update_3rdparty.py --gh-token ${{ secrets.GITHUB_TOKEN }} --modern-pdfjs" if: "endsWith(matrix.image, '-qt6')" - name: Run tox run: dbus-run-session tox -e ${{ matrix.testenv }} diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 3d96fdbee..2a7746b13 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -54,6 +54,11 @@ Changed setting (but not per-domain overrides). This fixes subtle JS issues on websites that rely on the custom header being sent for those requests, and e.g. block the requests server-side otherwise. (#8370) +- Our packaging scripts now prefer the "legacy"/"for older browsers" PDF.js + build as their normal release only supports the latest Chromium version and + might break in qutebrowser on updates. **Note to packagers:** If there's a + PDF.js package in your distribution as an (optional) qutebrowser dependency, + consider also switching to this variant (same code, built differently). Fixed ~~~~~ diff --git a/qutebrowser/html/no_pdfjs.html b/qutebrowser/html/no_pdfjs.html index 7b2d9bdf7..ca6795e27 100644 --- a/qutebrowser/html/no_pdfjs.html +++ b/qutebrowser/html/no_pdfjs.html @@ -110,9 +110,11 @@ li {
  • - You can manually download the pdf.js archive - here - and extract it to {{ pdfjs_dir }} + You can manually + download pdf.js + and extract it to {{ pdfjs_dir }}. Note the "older + browsers" ("legacy") build is recommended, the "modern browsers" + build only supports the latest Chromium release and might break.
    Warning: Using this method you are responsible for yourself to keep the installation updated! If a diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index c0482f414..2f1ab26c0 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -279,7 +279,7 @@ def build_mac( shutil.rmtree(d, ignore_errors=True) utils.print_title("Updating 3rdparty content") - update_3rdparty.run(ace=False, pdfjs=True, legacy_pdfjs=False, fancy_dmg=False, + update_3rdparty.run(ace=False, pdfjs=True, modern_pdfjs=False, fancy_dmg=False, gh_token=gh_token) utils.print_title("Building .app via pyinstaller") @@ -391,7 +391,7 @@ def build_windows( ) -> list[Artifact]: """Build windows executables/setups.""" utils.print_title("Updating 3rdparty content") - update_3rdparty.run(nsis=True, ace=False, pdfjs=True, legacy_pdfjs=False, + update_3rdparty.run(nsis=True, ace=False, pdfjs=True, modern_pdfjs=False, fancy_dmg=False, gh_token=gh_token) utils.print_title("Building Windows binaries") diff --git a/scripts/dev/update_3rdparty.py b/scripts/dev/update_3rdparty.py index 7ad27c915..7fd30ebca 100755 --- a/scripts/dev/update_3rdparty.py +++ b/scripts/dev/update_3rdparty.py @@ -89,14 +89,15 @@ def get_latest_pdfjs_url(gh_token, legacy): return (version_name, download_url) -def update_pdfjs(target_version=None, legacy=False, gh_token=None): +def update_pdfjs(target_version=None, legacy=True, gh_token=None): """Download and extract the latest pdf.js version. If target_version is not None, download the given version instead. Args: target_version: None or version string ('x.y.z') - legacy: Whether to download the legacy build for 83-based. + legacy: Whether to download the "legacy" build (the normal build only + supports the latest Chromium release). gh_token: GitHub token to use for the API. Optional except on CI. """ if target_version is None: @@ -115,7 +116,8 @@ def update_pdfjs(target_version=None, legacy=False, gh_token=None): os.chdir(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..')) target_path = os.path.join('qutebrowser', '3rdparty', 'pdfjs') - print(f"=> Downloading pdf.js {version}{' (legacy)' if legacy else ''}") + version_suffix = '' if legacy else ' (modern browsers version)' + print(f"=> Downloading pdf.js {version}{version_suffix}") try: (archive_path, _headers) = urllib.request.urlretrieve(url) except urllib.error.HTTPError as error: @@ -171,13 +173,13 @@ def test_dicts(): print('ERROR: {}'.format(response.status)) -def run(*, nsis=False, ace=False, pdfjs=True, legacy_pdfjs=False, fancy_dmg=False, +def run(*, nsis=False, ace=False, pdfjs=True, modern_pdfjs=False, fancy_dmg=False, pdfjs_version=None, dicts=False, gh_token=None): """Update components based on the given arguments.""" if nsis: download_nsis_plugins() if pdfjs: - update_pdfjs(pdfjs_version, legacy=legacy_pdfjs, gh_token=gh_token) + update_pdfjs(pdfjs_version, legacy=not modern_pdfjs, gh_token=gh_token) if ace: update_ace() if fancy_dmg: @@ -195,8 +197,8 @@ def main(): help='Specify pdfjs version. If not given, ' 'the latest version is used.', required=False, metavar='VERSION') - parser.add_argument("--legacy-pdfjs", - help="Use legacy PDF.js build (for 83-based)", + parser.add_argument("--modern-pdfjs", + help="Use PDF.js modern build (only supports latest Chromium)", action='store_true') parser.add_argument('--fancy-dmg', help="Update fancy-dmg Makefile", action='store_true') @@ -209,7 +211,7 @@ def main(): '--gh-token', help="GitHub token to use.", nargs='?') args = parser.parse_args() run(nsis=False, ace=True, pdfjs=True, fancy_dmg=args.fancy_dmg, - pdfjs_version=args.pdfjs, legacy_pdfjs=args.legacy_pdfjs, + pdfjs_version=args.pdfjs, modern_pdfjs=args.modern_pdfjs, dicts=args.dicts, gh_token=args.gh_token)