diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 8b87b0651..643d2fb4a 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -29,6 +29,11 @@ Changed * `qute-bitwarden` now passes your password to the subprocess in an environment variable when unlocking your vault, instead of as a command line argument. (#7781) +- New `-D no-system-pdfjs` debug flag to ignore system-wide PDF.js installations + for testing. +- Polyfill for missing `URL.parse` with PDF.js v5 and QtWebEngine < 6.9. Note + this is a "best effort" fix and you should be using the "older browsers" + ("legacy") build of PDF.js instead. Fixed ~~~~~ diff --git a/qutebrowser/javascript/pdfjs_polyfills.js b/qutebrowser/javascript/pdfjs_polyfills.js index 54e71652d..d27e1e65d 100644 --- a/qutebrowser/javascript/pdfjs_polyfills.js +++ b/qutebrowser/javascript/pdfjs_polyfills.js @@ -19,4 +19,16 @@ SPDX-License-Identifier: GPL-3.0-or-later return { promise, resolve, reject } } } + + // Chromium 126 / QtWebEngine 6.9 + // https://caniuse.com/mdn-api_url_parse_static + if (typeof URL.parse === "undefined") { + URL.parse = function(url, base) { + try { + return new URL(url, base); + } catch (e) { + return null; + } + } + } })();