22883 Commits

Author SHA1 Message Date
Calixte Denizet
5ca6026d80
Drop 'unsafe-inline' from the CSP style-src directives
The print service injected the per-PDF `@page { size }` rule as an inline
<style> element, which required 'unsafe-inline' on style-src-elem.

Inject it through a constructable CSSStyleSheet attached to
document.adoptedStyleSheets instead. Constructable stylesheets aren't
subject to style-src's inline restrictions in browsers.
2026-06-09 22:08:08 +02:00
calixteman
cb53dbecb9
Merge pull request #21419 from calixteman/chrome_ext_csp
[CRX] List all viewer-accessible schemes in the connect-src CSP
2026-06-09 21:32:08 +02:00
Tim van der Meij
c541d24ac3
Merge pull request #21407 from calixteman/fix_hidden_updated_field
Fix form fields with their own canvas updated on non-rendered pages
2026-06-09 20:03:20 +02:00
Tim van der Meij
29ad297626
Merge pull request #21409 from Snuffleupagus/PDFViewer-#setPrintingAllowed
Add a `PDFViewer` helper method for setting `#printingAllowed` and dispatching the event
2026-06-09 19:43:26 +02:00
Tim van der Meij
8a80f1b8b7
Merge pull request #21418 from Snuffleupagus/getAttachments-Map
[api-minor] Convert `getAttachments` to return data in a `Map`
2026-06-09 19:42:23 +02:00
Tim van der Meij
7f5b42140d
Merge pull request #21414 from calixteman/issue21406
Handle TR2 with /Default entry
2026-06-09 19:26:57 +02:00
Tim van der Meij
9e5cbcef50
Merge pull request #21421 from mozilla/dependabot/github_actions/github/codeql-action-4.36.1
Bump github/codeql-action from 4.36.0 to 4.36.1
2026-06-09 19:24:13 +02:00
Tim van der Meij
cf8677154b
Merge pull request #21420 from mozilla/dependabot/github_actions/actions/checkout-6.0.3
Bump actions/checkout from 6.0.2 to 6.0.3
2026-06-09 19:23:29 +02:00
calixteman
3602db7456
[CRX] List all viewer-accessible schemes in the connect-src CSP 2026-06-09 16:55:19 +02:00
dependabot[bot]
5140371ebe
Bump github/codeql-action from 4.36.0 to 4.36.1
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.36.0 to 4.36.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](7211b7c807...87557b9c84)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.36.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-09 12:14:30 +00:00
dependabot[bot]
380c4c8139
Bump actions/checkout from 6.0.2 to 6.0.3
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](de0fac2e45...df4cb1c069)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-09 12:13:07 +00:00
Jonas Jenwald
ea139e7df1 [api-minor] Convert getAttachments to return data in a Map
Compared to regular `Object`s there's a number of advantages to using `Map`s:
 - They support "proper" iteration.
 - They have a simple way to check for the existence of data.
 - They have a simple/efficient way to check the number of elements.

If this functionality was added today, I cannot imagine that we'd choose an `Object` for this sort of data.
Furthermore, in PR 21351 the data returned by `getAttachments` changed slightly and third-party users will need to update their code anyway (hence why `[api-minor]` should be fine here).
2026-06-09 10:17:23 +02:00
Calixte Denizet
473b53fe3c Handle TR2 with /Default entry
It fixes #21406.
2026-06-08 19:09:45 +02:00
calixteman
ea4fe68c01
Merge pull request #21405 from Snuffleupagus/scripting-rm-getOrInsertComputed-polyfill
Remove the `Map.prototype.getOrInsertComputed` polyfill from the scripting implementation (PR 21399 follow-up)
2026-06-08 17:25:47 +02:00
Calixte Denizet
ecd43bc8e1 Fix form fields with their own canvas updated on non-rendered pages
When a read-only field (which has its own canvas) is updated by the
sandbox while its page isn't rendered, showElementAndHideCanvas
isn't called, so once the page is finally rendered the field still
shows its outdated canvas instead of the new value.

Replace the imperative canvas/element toggling with a `sandboxModified`
class, set from the annotation storage both at render time and on
sandbox updates, and let the CSS show the element and hide the canvas.
2026-06-08 17:22:11 +02:00
calixteman
879437247b
Merge pull request #21408 from wooorm/wooorm/selection-color-transparent
Fix transparent color of `::selection` in Firefox
2026-06-08 16:57:34 +02:00
Jonas Jenwald
f93faae01c Add a PDFViewer helper method for setting #printingAllowed and dispatching the event
This reduces a little bit of code duplication, which shouldn't hurt.
2026-06-08 15:30:05 +02:00
Titus Wormer
7b54ec0a8d
Fix transparent color of ::selection in Firefox
This forces `color: transparent` on selections.
In latest Firefox Nightly, this is no longer inherited on
`::selection` from the normal element.

References: <753827d749>
2026-06-08 15:14:21 +02:00
calixteman
fadd201c09
Merge pull request #21404 from matasaru/master
fixed typo in README.md
2026-06-08 11:56:28 +02:00
Jonas Jenwald
5f83408099 Remove the Map.prototype.getOrInsertComputed polyfill from the scripting implementation (PR 21399 follow-up)
All unit- and integration-tests pass with this patch, and according to the QuickJS changelog this is supported now; note 3d5e064e9d/Changelog (L10) and https://github.com/tc39/proposal-upsert.
2026-06-08 11:48:42 +02:00
calixteman
52a44a68be
Merge pull request #21399 from calixteman/update_quickjs_3d5e064
Update quickjs to rev 3d5e064e9dd67c70f7962836505a7fa067bf0a4e
2026-06-08 10:38:44 +02:00
calixteman
7a7e4fd382 Update quickjs to rev 3d5e064e9dd67c70f7962836505a7fa067bf0a4e 2026-06-08 09:26:36 +02:00
radu
82098f175b fixed typo in README.md 2026-06-07 18:52:07 -04:00
Tim van der Meij
ff88446d01
Merge pull request #21402 from timvandermeij/updates
Update dependencies to the most recent versions
2026-06-07 17:08:06 +02:00
Jonas Jenwald
4a01dd669a
Merge pull request #21400 from Snuffleupagus/workflows-test-external-folder
Run various test-suite when the `external/` folder is modified
2026-06-07 16:52:39 +02:00
Tim van der Meij
4112c2953b
Upgrade @eslint/json to version 2.0.0
This is a major version bump, but the changelog at
https://github.com/eslint/json/releases/json-v2.0.0
doesn't indicate any breaking changes that should impact us.
2026-06-07 16:14:37 +02:00
Tim van der Meij
984fcd4bae
Update dependencies to the most recent versions 2026-06-07 16:13:36 +02:00
Jonas Jenwald
9c0b56ac07 Run various test-suite when the external/ folder is modified
Given that the `external/` folder contains various imported code/resources, all of which could affect functionality and/or rendering, it seems safest to simply run browser/font/integration/unit tests whenever any part of that folder is touched.
2026-06-07 16:03:40 +02:00
Tim van der Meij
f86b5abb05
Merge pull request #21398 from timvandermeij/codecov-ci-fix
Upgrade `codecov/codecov-action` to version 7.0.0
2026-06-07 15:39:39 +02:00
Tim van der Meij
b8ad7c8d0f
Upgrade codecov/codecov-action to version 7.0.0
Codecov had to migrate to a new Keybase account after losing access to
their old Keybase account, and because of that the old account got
bricked to prevent misuse [1] which resulted in GPG verification
failures in our builds [2]. This new version of the action fixes the
issue by using the new account.

Fixes #21394.

[1] https://github.com/codecov/codecov-action/issues/1956
[2] https://github.com/codecov/codecov-action/issues/1955
2026-06-07 14:52:24 +02:00
Tim van der Meij
d9eea18876
Merge pull request #21396 from Snuffleupagus/injectLinkAnnotations-move-call
Prevent intermittent issues when invoking the `PDFPageView.prototype.#injectLinkAnnotations` method
2026-06-07 14:42:14 +02:00
Tim van der Meij
bfc33678da
Merge pull request #21395 from Snuffleupagus/DrawLayerBuilder-cancel-optional-chaining
Shorten the `DrawLayerBuilder.prototype.cancel` method a tiny bit
2026-06-07 14:35:40 +02:00
Jonas Jenwald
43dd2781a0 Prevent intermittent issues when invoking the PDFPageView.prototype.#injectLinkAnnotations method
Looking at the coverage data there are cases where we attempt to insert inferred link-annotations *before* the annotationLayer has rendered, see [here](2348365874/blob/web/annotation_layer_builder.js (L246)), which shouldn't happen and why that's treated as an Error.

This is most likely caused by the asynchronicity of all the relevant code, since the `Autolinker` functionality can only be invoked after both the annotationLayer *and* the textLayer have finished rendering.
Given that those operations are asynchronous, by the time that they complete it's possible that the annotationLayer (and also the textLayer) has been replaced by a new instance. In that case we might thus attempt to inject inferred link-annotations before the "new" annotationLayer has rendered.

To avoid this intermittent issue, we now ensure that the annotationLayer and textLayer haven't changed between those layers rendering and the `Autolinker` functionality being invoked. (If they did change, then a future `render` call will trigger the inferred link-annotations handling).
2026-06-07 11:28:57 +02:00
Jonas Jenwald
0eca809589 Shorten the DrawLayerBuilder.prototype.cancel method a tiny bit
By replacing the early return with optional chaining, a pattern that we already use in lots of places, the code becomes a tiny bit shorter and more importantly the code coverage for this file becomes 100 percent.
2026-06-06 23:41:31 +02:00
Tim van der Meij
f12c463452
Merge pull request #21393 from Snuffleupagus/PDFCursorTools-tests
Add basic integration-tests for the `PDFCursorTools` functionality
2026-06-06 19:51:52 +02:00
Tim van der Meij
81f15c3437
Merge pull request #21390 from Snuffleupagus/getDocument-binary-string-unit-test
Add a unit-test for passing a binary string to `getDocument`
2026-06-06 19:46:45 +02:00
Tim van der Meij
f4d6b4ef85
Merge pull request #21391 from Snuffleupagus/getDocument-Node-fs-unit-test
Add a unit-test for passing a filesystem URL-string (in Node.js) to `getDocument`
2026-06-06 19:45:26 +02:00
Jonas Jenwald
0b3b101dbc Remove the unused GrabToPan.prototype.toggle method
Given that the cursor tools are managed via the `PDFCursorTools` class, of which the `GrabToPan` instance is essentially a (semi) private implementation detail, the `GrabToPan.prototype.toggle` method is completely unused and can thus be removed.
2026-06-06 17:27:19 +02:00
Jonas Jenwald
a5333f2a92 Add a unit-test for passing a binary string to getDocument
This format is obviously not very efficient however it's been supported since "forever" and there's even examples using, hence it seems like a good idea to actually test this.
2026-06-06 14:37:25 +02:00
Jonas Jenwald
ae30748956 Add basic integration-tests for the PDFCursorTools functionality 2026-06-06 14:32:15 +02:00
calixteman
2348365874
Merge pull request #21392 from Snuffleupagus/Autolinker-invalid-email-domain-test
Add one more unit-test case for invalid email domains in the `Autolinker` class
2026-06-06 13:17:11 +02:00
Jonas Jenwald
08b704d4b1 Add one more unit-test case for invalid email domains in the Autolinker class
This improves coverage for a branch of the `Autolinker` class that wasn't previously tested.
2026-06-06 11:57:22 +02:00
Jonas Jenwald
a7d32f4518 Add a unit-test for passing a filesystem URL-string (in Node.js) to getDocument
This improves coverage for a part of the API that previously wasn't tested.
2026-06-05 23:17:11 +02:00
Tim van der Meij
9c437e6ab4
Merge pull request #21388 from calixteman/strip_jbig2_header
Strip the JBIG2 file header from JBIG2Decode streams
2026-06-05 20:06:02 +02:00
Tim van der Meij
4ed78beb38
Merge pull request #21387 from Snuffleupagus/ChunkedStream-abort-reject
Reject the stream-capability when aborting the `ChunkedStreamManager`
2026-06-05 20:02:02 +02:00
Tim van der Meij
e34e11cf78
Merge pull request #21386 from KonstantinRight/print-params-flag-fix
fix typo in bit flag value for suppressCropClip
2026-06-05 19:58:58 +02:00
Tim van der Meij
c8fb1be7b6
Merge pull request #21389 from calixteman/readme_ccov
Update the README in order to add some info about code coverage
2026-06-05 19:57:18 +02:00
Calixte Denizet
9ab6b743ea Update the README in order to add some info about code coverage 2026-06-05 17:45:20 +02:00
calixteman
173e083c71
Merge pull request #21350 from calixteman/kb_shortcuts_l10n
Match editor keyboard shortcuts by event.code as a fallback
2026-06-05 17:19:17 +02:00
Calixte Denizet
88c52a1523 Strip the JBIG2 file header from JBIG2Decode streams
It's rendering correctly in Acrobat and PdfBox.
2026-06-05 16:31:44 +02:00