215 Commits

Author SHA1 Message Date
Calixte Denizet
064e6a8b1c
Remove gulp-sourcemaps dependency which is unmaintained 2026-03-05 22:28:44 +01:00
Nicolò Ribaudo
ad91f3abc8
Ignore directories in lint-licenses task
The glob pattern will include directories that have a name ending,
for example, with `.js`.
2026-03-04 16:24:28 +01:00
Nicolò Ribaudo
2f2d5c9e27
Add script to check license headers 2026-03-04 10:40:39 +01:00
calixteman
2eb145f3f1
Use a babel plugin in order to strip /src/ from the import paths 2026-03-01 22:17:30 +01:00
Tim van der Meij
4cb0d504b0
Update dependencies to the most recent versions 2026-03-01 20:42:19 +01:00
calixteman
f57b73d881
Remove dependency to yargs and use node:utils parseArgs 2026-03-01 15:01:31 +01:00
Calixte Denizet
82fdeaaac0 Add a script for searching the unused fluent ids 2026-02-27 19:16:15 +01:00
Tim van der Meij
aaf3ad5a4e
Merge pull request #20688 from calixteman/coverage_font_test
Add code coverage for font tests
2026-02-20 22:13:57 +01:00
calixteman
34ba2064e6
Merge pull request #20661 from timvandermeij/updates
Update dependencies and translations to the most recent versions, and upgrade most packages to new major versions
2026-02-20 17:41:58 +01:00
calixteman
e2af2b83c3
Add code coverage for font tests 2026-02-18 22:00:45 +01:00
calixteman
2b57ef4b56
Fix code coverage line mapping
When checking the code coverage report, it was noticed that the line numbers were off.
It was due to the fact that the files used for coverage were the transpiled ones,
when the ones used by Codecov were the original ones.
So this patches adds the source maps to the transpiled files, and also updates
the license header in the original files in using a babel plugin in order
to make sure the line numbers are correct.
As a side effect of this work, it's now possible to have the correct line
numbers in the stack traces when running tests with the transpiled files.
2026-02-15 23:03:07 +01:00
Tim van der Meij
9edfeb0d33
Update dependencies to the most recent versions 2026-02-14 19:49:26 +01:00
calixteman
07dbda2d80
Add code coverage for unit tests running in node
It's a first step to add code coverage.
In order to get the code coverage report locally, you can run the following command:
```bash
npx gulp unittestcli --coverage
```
The code coverage report will be generated in the `./build/coverage` directory.
And the report can be consulted by opening:
  http://localhost:8888/build/coverage/index.html

A GitHub workflow has also been added to run the unit tests with code coverage
on each push and pull request. The report will be uploaded to Codecov.
2026-02-14 15:22:35 +01:00
calixteman
0b5f402158
Merge pull request #20639 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2026-02-09 17:48:10 +01:00
Jonas Jenwald
385c936318 [api-minor] Update the minimum supported Google Chrome version to 118
This patch updates the minimum supported browsers as follows:
 - Google Chrome 118, which was released on 2023-10-10; see https://chromereleases.googleblog.com/2023/10/stable-channel-update-for-desktop_10.html

We haven't made any changes to the supported Google Chrome version for a year, and this change allows us to remove "hacks" needed to support `float: inline-start/inline-end` in old browsers; see https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/float#browser_compatibility.

Note that nowadays we usually try, where feasible and possible, to support browsers that are about two years old. By limiting support to only "recent" browsers we reduce the risk of holding back improvements of the *built-in* Firefox PDF Viewer, and also (significantly) reduce the maintenance/support burden for the PDF.js contributors.

*Please note:* As always, the minimum supported browser version assumes that a `legacy`-build of the PDF.js library is being used; see https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support
2026-02-09 12:16:46 +01:00
Tim van der Meij
0c5a590bbd
Update dependencies to the most recent versions 2026-02-08 18:55:55 +01:00
Jonas Jenwald
a80f8ff014 [api-minor] Update the supported Node.js "patch" versions
We haven't made any changes to the supported Node.js versions for close to a year, however now seems like a good time to do so in order to unblock future (major version) package upgrades.

 - Babel version `8` is now close to release, since https://github.com/babel/babel/releases contain an 8-RC version and according to [this article](https://babel.dev/blog/2026/01/31/7.29.0) no new `7` releases are planned.
   See also https://babel.dev/blog/2025/05/30/babel-8-beta and note the supported Node.js versions in https://next.babeljs.io/docs/v8-migration/#nodejs-support

 - ESLint version `10` was just released, see https://eslint.org/blog/2026/02/eslint-v10.0.0-released/ and note the supported Node.js versions in https://eslint.org/docs/latest/use/migrate-to-10.0.0#-nodejs--v2019-v21-v23-are-no-longer-supported
2026-02-08 12:32:09 +01:00
Tim van der Meij
f4326e17c4
Merge pull request #20610 from calixteman/brotli
Add support for Brotli decompression
2026-02-01 20:41:06 +01:00
Jonas Jenwald
839c257f87 Replace the IDownloadManager interface with an abstract BaseDownloadManager class
This should help reduce the maintenance burden of the code, since you no longer need to remember to update separate code when touching the different `DownloadManager` classes.
2026-02-01 17:56:03 +01:00
calixteman
43273fde27
Add support for Brotli decompression
For now, `BrotliDecode` hasn't been specified but it should be in a
close future.
So when it's possible we use the native `DecompressionStream` API
with "brotli" as argument.
If that fails or if we've to decompress in a sync context, we fallback
to `BrotliStream` which a pure js implementation (see README in external/brotli).
2026-01-31 16:25:53 +01:00
Jonas Jenwald
5d02076313 Add tests (and CI) to ensure that preference generation works correctly for all relevant build-targets
Given that previous patches reduced that number of build-targets running this code, ensure that it's still tested sufficiently.
2026-01-30 13:31:13 +01:00
Jonas Jenwald
2a83f955b0 Make getDefaultPreferences a synchronous function, to simplify the build scripts 2026-01-30 13:26:19 +01:00
Jonas Jenwald
06cf7dd7b0 Stop pre-building the preference defaults, to simplify the build scripts
This is a left-over from before the introduction of `AppOptions`, but is no longer necessary now.
2026-01-30 13:26:19 +01:00
Jonas Jenwald
35e78f7f11 Generate the preferences_schema.json file, for the Chromium addon, during building
This avoids the hassle of having to manually update that file when adding/modifying preferences in the viewer.
Updating the preferences-metadata should now only be something that the Chromium addon maintainer has to do.
2026-01-30 13:26:16 +01:00
Jonas Jenwald
663d4cd6e7 Use standard ReadableStreams in the src/display/node_stream.js code
Thanks to newer Node.js functionality, see https://nodejs.org/api/stream.html#streamreadabletowebstreamreadable-options, we can use standard `ReadableStream`s which help to significantly shorten and simplify the code.

For older Node.js versions we use the `node-readable-to-web-readable-stream` package, see https://www.npmjs.com/package/node-readable-to-web-readable-stream, to get the same functionality.
2026-01-25 12:34:47 +01:00
David Giessing
0aa4fc6af8
fix: Update image pattern in gulpfile to accommodate missing images 2026-01-22 23:01:46 +01:00
Tim van der Meij
cb36cbdc13
Merge pull request #20547 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2026-01-03 23:32:02 +01:00
calixteman
98c1955bd4
Use the PDFium JBig2 decoder compiled into wasm
The decoder is ~4x faster than the JS decoder on large images.
2026-01-03 22:05:14 +01:00
Tim van der Meij
2838e161b8
Update dependencies to the most recent versions 2026-01-03 20:38:22 +01:00
Tim van der Meij
c5db38dd86
Update dependencies to the most recent versions 2025-12-22 16:26:37 +01:00
calixteman
2367196a00
Change the sidebar for a views manager
Update the styles and HTML to reflect the new views manager concept.
For now, nothing about split/merge functionality is implemented or visible.
The new styles for the outline, attachments, and layers will be added later.

The thumbnail view is now accessible with the keyboard.
2025-12-15 17:43:52 +01:00
Calixte Denizet
4bf759404c
Add a new linting task in order to detect unused/unknown css variables in the Firefox build
The goal is to be able to catch the errors before making a release.
And fix some css issues (especially the missing css code for the newly added menu.css)
2025-12-08 09:44:33 +01:00
Tim van der Meij
758856e664
Update dependencies to the most recent versions
Note that the `prettier` update requires a small bit of reformatting in
the Gulpfile so that linting keeps passing.
2025-11-29 18:52:33 +01:00
Calixte Denizet
b9368b576d Lint and format the HTML in using Prettier
The linter found some issues in viewer.html with </input> which isn't required
and a missing closing div in test/resources/reftest-analyzer.html.
The HTML can now be nicely formatted. In order to not break the build for
mozilla-central, the preprocessor has been fixed in order to take into account
the white spaces at the beginning of a comment line.
And finally, make .prettierrc (which is supposed to be either json or yaml)
itself lintable.
2025-11-18 17:22:50 +01:00
Tim van der Meij
cbd2b3d426
Update dependencies to the most recent versions 2025-10-26 16:40:07 +01:00
Tim van der Meij
6bd5c7cdb3
Update dependencies to the most recent versions 2025-10-14 20:26:50 +02:00
Tim van der Meij
a730cba414
Update dependencies to the most recent versions 2025-09-14 19:23:34 +02:00
Tim van der Meij
4dcfc96703
Update dependencies to the most recent versions 2025-08-30 18:38:25 +02:00
Tim van der Meij
d49fc494cd
Update dependencies to the most recent versions 2025-08-17 16:32:29 +02:00
Calixte Denizet
605c9be94f Add comment-* images when building components
It fixes #20127.
2025-07-28 14:30:03 +02:00
Tim van der Meij
5d6023cb2a
Update dependencies to the most recent versions 2025-07-19 18:39:16 +02:00
Tim van der Meij
7a129f8eae
Update dependencies to the most recent versions 2025-07-12 20:20:05 +02:00
Tim van der Meij
7f619c7605
Update dependencies to the most recent versions 2025-06-22 15:24:53 +02:00
Jonas Jenwald
d81174d7bc
Merge pull request #19956 from Snuffleupagus/versionInfoHeader
Improve how the PDF.js version/commit information is exposed in the *built* files
2025-05-22 15:24:02 +02:00
calixteman
32789073a9
Revert "Minify the js code when building for Firefox (bug 1965003)" 2025-05-22 14:08:31 +02:00
Jonas Jenwald
97a42486f5 Improve how the PDF.js version/commit information is exposed in the *built* files
To make it easier to tell which PDF.js version/commit that the *built* files correspond to, they have (since many years) included `pdfjsVersion` and `pdfjsBuild` constants with that information.

As currently implemented this has a few shortcomings:
 - It requires manually adding the code, with its preprocessor statements, in all relevant files.

 - It requires ESLint disable statements, since it's obviously unused code.

 - Being unused, this code is removed in the minified builds.

 - This information would be more appropriate as comments, however Babel discards all comments during building.

 - It would be helpful to have this information at the top of the *built* files, however it's being moved during building.

To address all of these issues, we'll instead utilize Webpack to insert the version/commit information as a comment placed just after the license header.
2025-05-19 15:01:05 +02:00
Tim van der Meij
d297e44f3f
Update dependencies to the most recent versions 2025-05-17 15:50:54 +02:00
Jonas Jenwald
13c9995455 Enable the unicorn/prefer-import-meta-properties ESLint plugin rule
Given that we require Node.js versions `>=20.16.0 || >=22.3.0` using this should be fine, based on the "History" data in https://nodejs.org/api/esm.html#importmetadirname respectively https://nodejs.org/api/esm.html#importmetafilename.

Please also see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-import-meta-properties.md
2025-05-16 07:47:08 +02:00
Calixte Denizet
8129ccc9a7 Minify the js code when building for Firefox (bug 1965003)
It helps to improve the loading time in the worker by around 25% on Windows, Mac and Android.
2025-05-15 19:01:52 +02:00
Nicolò Ribaudo
aebe0cb67f
Remove unused OpenJPEG wasm fallback logic
Emscripten generates code that allows the caller to provide the Wasm
module (thorugh Module.instantiateWasm), with a fallback in case
.instantiateWasm is not provided. We always define instantiateWasm, so
we can hard-code the check and let our dead code elimination logic
remove the unused fallback.

This commit also improved the dead code elimination logic so that if
a function declaration becomes unused as a result of removing dead
code, the function itself is removed.
2025-05-13 19:38:17 +02:00