Closed Bug 1859135 Opened 4 months ago Closed 4 months ago

Update PDF.js to new version 5c45dfa0ae97d03d171229b2609c97f6b10cdba7 from 2023-10-14 12:36:25


(Firefox :: PDF Viewer, enhancement)




120 Branch
Tracking Status
firefox120 --- fixed


(Reporter: update-bot, Assigned: calixte)


(Blocks 1 open bug)


(Whiteboard: [3pl-filed][task_id: VTWG5MFaQo-kTSThd5bvWw])


(1 file)

This update covers 13 commits. Here are the overall diff statistics, and then the commit information.

toolkit/components/pdfjs/content/build/pdf.mjs | 14 +-
toolkit/components/pdfjs/content/build/pdf.scripting.mjs | 4 +-
toolkit/components/pdfjs/content/build/pdf.worker.mjs | 6 +-
toolkit/components/pdfjs/content/web/viewer-geckoview.mjs | 108 ++++---------
toolkit/components/pdfjs/content/web/viewer.mjs | 108 ++++---------
toolkit/components/pdfjs/moz.yaml | 4 +-
6 files changed, 88 insertions(+), 156 deletions(-)

58e4fcdc6f15e9ab7aafc000510becfba6e55069 by Tim van der Meij
Authored: 2023-10-14 14:01:51 +0200
Committed: 2023-10-14 14:07:49 +0200

Remove obsolete src/shared/{cffStandardStrings,fonts_utils}.js files

Those files only contain old debugging code that is not used/imported
anywhere anymore, which is generating code scanning alerts. Moreover,
they rely on globals/platform-specific code and don't import/export
logic properly.

Files Deleted:

  • src/shared/cffStandardStrings.js
  • src/shared/fonts_utils.js

Files Modified:

  • gulpfile.mjs

4c17f99fab8985463303e1a5da5df1ce3b2bbb0c by Tim van der Meij
Authored: 2023-10-14 13:46:57 +0200
Committed: 2023-10-14 13:50:24 +0200

Fix dependency vulnerabilities with npm audit fix

Files Modified:

  • package-lock.json

e1307fdba8602fad908f289610171c545555cac7 by Tim van der Meij
Authored: 2023-10-14 13:44:21 +0200
Committed: 2023-10-14 13:50:19 +0200

Update dependencies to the most recent versions

Files Modified:

  • gulpfile.mjs
  • package-lock.json
  • package.json

e79bb25086cc24614184c3eede49a7c35e905004 by Tim van der Meij
Authored: 2023-10-14 13:32:49 +0200
Committed: 2023-10-14 13:50:12 +0200

Update translations to the most recent versions

Files Modified:

  • l10n/be/
  • l10n/cy/
  • l10n/da/
  • l10n/de/
  • l10n/el/
  • l10n/es-ES/
  • l10n/fi/
  • l10n/fr/
  • l10n/fur/
  • l10n/fy-NL/
  • l10n/gn/
  • l10n/it/
  • l10n/ja/
  • l10n/ka/
  • l10n/nl/
  • l10n/nn-NO/
  • l10n/pa-IN/
  • l10n/pt-BR/
  • l10n/rm/
  • l10n/ru/
  • l10n/sk/
  • l10n/tg/
  • l10n/tr/
  • l10n/vi/
  • l10n/zh-TW/

d53093045a6ba07cbf6c58c140934ea85d7b4a04 by Jonas Jenwald
Authored: 2023-10-14 12:38:17 +0200
Committed: 2023-10-14 12:49:17 +0200

Enable the import/no-commonjs ESLint plugin rule

Given the amount of work put into removing require-calls from the code-base, let's ensure that new ones aren't accidentally added in the future.

Note that we still have a couple of files where require is being used, in particular:

  • The Node.js examples, however those will be updated to use import in PR 17081.
  • The Webpack examples, and related support files, however I unfortunately don't know enough about Webpack to be able to update those. (Hopefully users of that code will help out here, once version 4 is released.)
  • The statcmp-tool, since some of those require-calls cannot be converted to import without other code changes (and that file is only used during benchmarking).

Please find additional details at

Files Modified:

  • .eslintrc
  • examples/node/getinfo.js
  • examples/node/pdf2png/pdf2png.js
  • examples/webpack/main.js
  • examples/webpack/webpack.config.js
  • external/dist/webpack.js
  • src/pdf.worker.entry.js
  • test/chromium/test-telemetry.js
  • test/stats/statcmp.js

af9a7b0003d5300ebc98a08cd3ab02204a293825 by Jonas Jenwald
Authored: 2023-10-09 09:59:11 +0200
Committed: 2023-10-14 11:34:40 +0200

Tweak PDFWorkerUtil.createCDNWrapper to account for JavaScript modules (PR 17055 follow-up)

Files Modified:

  • src/display/api.js

5e986cb5142147e7b72c1f96b0acd2bef0d5fa4c by Jonas Jenwald
Authored: 2022-04-02 13:00:25 +0200
Committed: 2023-10-13 20:35:34 +0200

Use native import maps in development mode

This patch seem to work fine locally now, and mozregression points to it being fixed in bug which landed in Firefox 116.

By using the native import maps functionality, we can remove a development dependency. Please find the specification at

Files Modified:

  • package-lock.json
  • package.json
  • test/font/font_test.html
  • test/unit/unit_test.html
  • web/viewer-geckoview.html
  • web/viewer.html

38245500fde2ac10c993c1690057cacd6b2b0383 by Jonas Jenwald
Authored: 2023-10-13 12:11:29 +0200
Committed: 2023-10-13 18:54:33 +0200

Output JavaScript modules for the LIB build-target (PR 17055 follow-up)

This finally allows us to mark the entire PDF.js library as a "module", which should thus conclude the (multi-year) effort to re-factor and improve how we import files/resources in the code-base.

This also means that the gulp ci-test target, which is what's run in GitHub Actions, now uses JavaScript modules since that's supported in modern Node.js versions.

Files Modified:

  • extensions/firefox/.eslintrc
  • gulpfile.mjs
  • package-lock.json
  • package.json
  • src/display/node_stream.js
  • src/display/node_utils.js
  • test/stats/statcmp.js
  • test/unit/node_stream_spec.js
  • test/unit/test_utils.js

cabda362c66cfc165cf724cd139c85e293e71979 by Calixte Denizet
Authored: 2023-10-12 16:32:44 +0200
Committed: 2023-10-12 16:32:44 +0200

Remove useless file (bug 1858700)

Files Deleted:

  • l10n/en-US/

9878d058fe1f5d2c2874fd31e3a19c5ec418bec5 by Jonas Jenwald
Authored: 2023-10-12 13:16:58 +0200
Committed: 2023-10-12 13:18:20 +0200

Convert the integration test-files to JavaScript modules

Files Modified:

  • test/integration/accessibility_spec.mjs
  • test/integration/annotation_spec.mjs
  • test/integration/copy_paste_spec.mjs
  • test/integration/find_spec.mjs
  • test/integration/freetext_editor_spec.mjs
  • test/integration/ink_editor_spec.mjs
  • test/integration/scripting_spec.mjs
  • test/integration/stamp_editor_spec.mjs
  • test/integration/test_utils.mjs

33456d370454f20d61cd8e79603f60c17edccd9a by Jonas Jenwald
Authored: 2023-10-12 12:39:39 +0200
Committed: 2023-10-12 13:17:56 +0200

Rename the integration test-files, in preparation for converting them to modules

This is done separately to ensure that Git is able to track the history correctly.

Files Modified:

  • test/integration-boot.mjs

Files Changed:

  • R100 test/integration/accessibility_spec.js
  • R100 test/integration/annotation_spec.js
  • R100 test/integration/copy_paste_spec.js
  • R100 test/integration/find_spec.js
  • R100 test/integration/freetext_editor_spec.js
  • R100 test/integration/ink_editor_spec.js
  • R100 test/integration/scripting_spec.js
  • R100 test/integration/stamp_editor_spec.js
  • R100 test/integration/test_utils.js

0238cf134d1689d010e81bd81f837fbc650a8d8c by Jonas Jenwald
Authored: 2023-10-10 19:01:16 +0200
Committed: 2023-10-11 11:51:42 +0200

Don't store page-level data, in the API, after cleanup has run (bug 1854145)

For large/complex images it's possible that the image-data arrives in the API after the page has been scrolled out-of-view and thus been cleaned-up. In this case we obviously shouldn't cache such page-level data, since it'll first of all be unused and secondly can increase memory usage a lot.
Also, ensure that we immediately release any ImageBitmap data in this case to help reclaim memory faster.

Files Modified:

  • src/display/api.js

734caab74705cf6b4f4522154fed8515220bc35f by Jonas Jenwald
Authored: 2023-10-10 09:34:39 +0200
Committed: 2023-10-10 09:41:01 +0200

Update the "Interactive examples" links (PR 17055 follow-up)

The examples themselves were updated to account for JavaScript modules, which didn't require changing the actual URLs.
However, since it seems that JSFiddle doesn't support JavaScript modules in its separate "JavaScript" editing-area we need to change how we embed the examples to avoid showing a blank "JavaScript"-tab.

Files Modified:

  • docs/contents/examples/

All the jobs in the try run succeeded. Like literally all of them, there weren't
even any intermittents. That is pretty surprising to me, so maybe you should double
check to make sure I didn't misinterpret things and that the correct tests ran...

Anyway, I've done all I can, so I'm passing to you to review and land the patch.
When reviewing, please note that this is external code, which needs a full and
careful inspection - not a rubberstamp.

Assignee: nobody → cdenizet
Pushed by
Update PDF.js to 5c45dfa0ae97d03d171229b2609c97f6b10cdba7 r=pdfjs-reviewers,calixte
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
You need to log in before you can comment on or make changes to this bug.