Update PDF.js to new version 94a48f3c844d4677b264b6e7c0a1e239c245189f from 2026-11-10 18:03:07 UTC
Categories
(Firefox :: PDF Viewer, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: update-bot, Assigned: update-bot)
References
(Blocks 1 open bug)
Details
(Whiteboard: [3pl-filed][task_id: DWCQTgleSnWyn8XFyZlJsw])
Attachments
(1 external file)
This update covers 10 commits, including 4 new upstream commits I've never filed a bug on before. (They're the top 4.). Here are the overall diff statistics, and then the commit information.
toolkit/components/pdfjs/PdfJsDefaultPrefs.js | 2 +-
toolkit/components/pdfjs/content/PdfJsVersion.sys.mjs | 2 +-
toolkit/components/pdfjs/content/build/pdf.mjs | 18 +-
toolkit/components/pdfjs/content/build/pdf.renderer.mjs | 6 +-
toolkit/components/pdfjs/content/build/pdf.scripting.mjs | 4 +-
toolkit/components/pdfjs/content/build/pdf.worker.mjs | 135 ++++++---
toolkit/components/pdfjs/content/web/viewer-geckoview.css | 8 +
toolkit/components/pdfjs/content/web/viewer-geckoview.mjs | 13 +-
toolkit/components/pdfjs/content/web/viewer.css | 8 +
toolkit/components/pdfjs/content/web/viewer.html | 20 +
toolkit/components/pdfjs/content/web/viewer.mjs | 24 +-
toolkit/components/pdfjs/content/web/wasm/hellbox_nowasm_fallback.js | 2 -
toolkit/components/pdfjs/content/web/wasm/hellbox_nowasm_fallback.js.br | Bin
toolkit/components/pdfjs/content/web/wasm/jbig2_nowasm_fallback.js | 2 -
toolkit/components/pdfjs/content/web/wasm/jbig2_nowasm_fallback.js.br | Bin
toolkit/components/pdfjs/content/web/wasm/openjpeg_nowasm_fallback.js | 2 -
toolkit/components/pdfjs/content/web/wasm/openjpeg_nowasm_fallback.js.br | Bin
toolkit/components/pdfjs/moz.yaml | 4 +-
18 files changed, 165 insertions(+), 85 deletions(-)
7f795dc8e866f5b7d9c5c8c38c28520f37d4b202 by Calixte Denizet <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/7f795dc8e866f5b7d9c5c8c38c28520f37d4b202
Authored: 2026-11-10 15:24:25 +0100
Committed: 2026-11-10 18:13:58 +0100
Compile Wasm modules while they're being fetched in the worker
Use WebAssembly.compileStreaming in order to compile the module while it's
downloaded. The response is re-wrapped with the exact application/wasm MIME
type since streaming compilation rejects any parameter, e.g. the charset
Firefox adds to resource:// responses.
Files Modified:
- src/core/wasm_loader.js
- test/unit/wasm_loader_spec.js
f082a0f05e1f4ec05d5ba7c7bf6351295cae60dd by Calixte Denizet <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/f082a0f05e1f4ec05d5ba7c7bf6351295cae60dd
Authored: 2026-11-10 10:48:56 +0100
Committed: 2026-11-10 15:36:42 +0100
[Firefox] Ship the Wasm JS fallbacks compressed with Brotli
The JS fallbacks are only used when Wasm is unavailable, so in the Firefox
build they're compressed at max quality and decompressed with a
DecompressionStream before being imported from a blob URL.
It reduces their size from 678kB to 167kB.
Files Modified:
- gulpfile.mjs
- src/core/wasm_loader.js
- test/unit/wasm_loader_spec.js
39e2b4511caccba6f69644f90ed55af4a2834aa8 by Jonas Jenwald <jonas.jenwald@gmail.com>
https://github.com/mozilla/pdf.js/commit/39e2b4511caccba6f69644f90ed55af4a2834aa8
Authored: 2026-11-10 12:13:17 +0100
Committed: 2026-11-10 14:21:33 +0100
Re-factor the fetchBuiltInCMap method in the PartialEvaluator class
-
Re-factor the
fetchBuiltInCMapfunctionality to use the newWasmLoader.fetchmethod, to reduce unnecessary code duplication. -
Inline the
fetchBinaryDatahelper in theWasmLoader.fetchmethod, since that's now its only call-site. -
The built-in CMap cache now stores promises, rather than raw data, which prevents back-to-back
fetchBuiltInCMapcalls from fetching the same data multiple times.
Note that in practice, given how font-parsing is implemented, this should not have been a problem.
Files Modified:
- src/core/cmap.js
- src/core/core_utils.js
- src/core/evaluator.js
- src/core/wasm_loader.js
- test/unit/test_utils.js
28aaa4900739e8d09d4c4048cfbbb77d99a057b8 by Jonas Jenwald <jonas.jenwald@gmail.com>
https://github.com/mozilla/pdf.js/commit/28aaa4900739e8d09d4c4048cfbbb77d99a057b8
Authored: 2026-11-09 22:35:30 +0100
Committed: 2026-11-09 22:48:16 +0100
Enable "large window" support in the Brotli JS decoder (issue 22487)
While the Brotli decoder does contain an enableLargeWindow function, it however does not currently expose any option for it. Note that according to this document, a Brotli decoder needs to have "large window" support.
Hence, until an option is exposed upstream, we can patch that in via the "release-brotli" gulp task.
Files Added:
- test/pdfs/issue22487.pdf
Files Modified:
- external/brotli/README.md
- external/brotli/decode.js
- gulpfile.mjs
- test/pdfs/.gitignore
- test/test_manifest.json
f1f16cabd29de1db9694bf0cddbdd3613c98753e by Jonas Jenwald <jonas.jenwald@gmail.com>
https://github.com/mozilla/pdf.js/commit/f1f16cabd29de1db9694bf0cddbdd3613c98753e
Authored: 2026-11-09 18:01:52 +0100
Committed: 2026-11-09 18:05:53 +0100
Support /BrotliDecode streams with predictors (issue 22486)
Files Added:
- test/pdfs/issue22486.pdf
Files Modified:
- src/core/parser.js
- test/pdfs/.gitignore
- test/test_manifest.json
5a7a44db7a7cba537f1071d4eea848d015961a11 by Calixte Denizet <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/5a7a44db7a7cba537f1071d4eea848d015961a11
Authored: 2026-11-09 09:26:00 +0100
Committed: 2026-11-09 14:39:43 +0100
Fix the measurement of b and i elements in XFA rich text
TextMeasure has no pushFont method, so laying out any rich text
containing a <b> or an <i> threw and no page was rendered.
It fixes #22023.
Files Added:
- test/pdfs/xfa_issue22023.pdf
Files Modified:
- src/core/xfa/xhtml.js
- test/pdfs/.gitignore
- test/test_manifest.json
- test/unit/xfa_tohtml_spec.js
- web/xfa_layer_builder.css
ce31961cb15fba5e72cbcd6d85bdc2f22a1212af by Calixte Denizet <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/ce31961cb15fba5e72cbcd6d85bdc2f22a1212af
Authored: 2026-11-05 21:01:11 +0100
Committed: 2026-11-08 22:23:25 +0100
Start loading the viewer icons earlier in Firefox
The CSS only fetches an icon once its element is rendered, so the toolbar is
first painted without icons and the menus load theirs when first opened.
Preload the toolbar icons from viewer.html (without crossorigin, since CSS
images from resource:// are fetched without CORS), and warm the image cache
up with the icons of the hidden UI once the first page is rendered.
Files Modified:
- web/app.js
- web/viewer.css
- web/viewer.html
9f439dd1a485dd64ac1dcc2d645e4735c73a2b23 by calixteman <calixte.denizet@gmail.com>
https://github.com/mozilla/pdf.js/commit/9f439dd1a485dd64ac1dcc2d645e4735c73a2b23
Authored: 2026-11-07 20:05:54 +0100
Committed: 2026-11-08 22:00:28 +0100
Allow pinch-to-zoom while some momentum scrolling is in progress (bug 1915803)
Zooming with ctrl+wheel is ignored while scrolling in order to avoid
zooming when the ctrl key is pressed during momentum scrolling (issue #7022).
But a pinch-to-zoom gesture on a trackpad doesn't involve the physical ctrl key,
so it must zoom even if the document is still scrolling.
Files Modified:
- test/integration/viewer_spec.mjs
- web/app.js
108697d33496fc01ae3cbc3f7348b153f61458ea by Tim van der Meij <info@timvandermeij.nl>
https://github.com/mozilla/pdf.js/commit/108697d33496fc01ae3cbc3f7348b153f61458ea
Authored: 2026-11-08 18:37:48 +0100
Committed: 2026-11-08 18:51:32 +0100
Deny install scripts of dependencies in package.json
NPM 12 no longer runs install scripts of dependencies by default anymore
to combat supply chain attacks [1], and warns if they are blocked without
explicit denylisting. For PDF.js this currently results in:
npm warn install-scripts 3 packages had install scripts blocked because they are not covered by allowScripts:
npm warn install-scripts core-js@3.51.0 (postinstall: node -e "try{require('./postinstall')}catch(e){}")
npm warn install-scripts puppeteer@25.16.0 (postinstall: node install.mjs)
npm warn install-scripts unrs-resolver@1.11.1 (postinstall: napi-postinstall unrs-resolver 1.11.1 check)
We don't need any of the install scripts, and this commit thus
explicitly marks them as denied, because:
core-jsonly uses it to print a sponsor banner [2];puppeteeronly uses it to facilitate browser binary downloading, but
we already switched away from install-time downloads before in favor
of only downloading them when we actually need them for tests [3];unrs-resolveronly uses it to work around bugs in legacy NPM
versions, and this postinstall script recently got removed as well [4].
[1] https://github.blog/changelog/2026-06-09-upcoming-breaking-changes-for-npm-v12
[2] https://github.com/zloirock/core-js/blob/master/packages/core-js/postinstall.js#L25
[3] https://github.com/mozilla/pdf.js/commit/26b4206d879673f8e2cbbb615b59bb211c8ea3fc
[4] https://github.com/unrs/unrs-resolver/pull/225
Files Modified:
- package.json
0600b01dfefb969417af6075edc8479aea0b2b67 by Jonas Jenwald <jonas.jenwald@gmail.com>
https://github.com/mozilla/pdf.js/commit/0600b01dfefb969417af6075edc8479aea0b2b67
Authored: 2026-11-08 11:29:02 +0100
Committed: 2026-11-08 11:33:25 +0100
Enable the split/merge feature by default
This feature has been enabled in Firefox since bug 2018919 and bug 2030179, hence it seems that we can just enable it by default now.
Files Modified:
- web/app_options.js
| Assignee | ||
Comment 2•17 days ago
|
||
| DWCQTgleSnWyn8XFyZlJsw | ||
I've submitted a try run for this commit: https://treeherder.mozilla.org/jobs?repo=try&revision=ed15fd25419cf89c8d370bf22145096ffc89e466
| Assignee | ||
Comment 3•17 days ago
|
||
Updated•17 days ago
|
Updated•16 days ago
|
Updated•16 days ago
|
Comment 5•15 days ago
|
||
| bugherder | ||
| Assignee | ||
Comment 6•15 days ago
|
||
| CVIEw35gQ12Dtl42KVqvWg | ||
It looks like we experienced one or more build failures when trying to apply this
update. You will need to apply this update manually; you can replicate the patch
locally with ./mach vendor toolkit/components/pdfjs/moz.yaml --revision 94a48f3c844d4677b264b6e7c0a1e239c245189f. I'm going to abandon the Phabricator patch and
let you submit a new one.
If the build failure wasn't caused by a library change, and was instead caused by
something structural in the build system please let my maintainers know in
Slack:#secinf.
I do my best to automatically add new files to the build, but some moz.build files
are complicated and you may need to fix them manually.
Updated•6 hours ago
|
Description
•