Repository navigation
Catch getPermissions errors in PDFViewer.prototype.setDocument - #22168
Merged
timvandermeij merged 1 commit intoOct 13, 2026
Merged
Conversation
If permissions are enabled and the `getPermissions` API-method somehow rejects, the viewer would fail to initialize and nothing would be rendered. *Note:* This is based solely on code inspection, and it's similar to how we ignore errors elsewhere in the viewer: https://github.com/mozilla/pdf.js/blob/6c71c0bf2670e38d689b9ed28cdd9c709e45b758/web/app.js#L1681-L1691
Contributor
Viewer previewποΈ Viewer previews removed. |
sync-pdfs-for-pdf-js Bot
pushed a commit
to mozilla/pdf.js.refs
that referenced
this pull request
Oct 13, 2026
Codecov Reportβ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22168 +/- ##
=======================================
Coverage 90.34% 90.34%
=======================================
Files 277 277
Lines 68030 68031 +1
=======================================
+ Hits 61461 61462 +1
Misses 6569 6569
Flags with carried forward coverage won't be shown. Click here to find out more. β View full report in Codecov by Harness. π New features to boost your workflow:
|
timvandermeij
approved these changes
Oct 13, 2026
Collaborator
|
It seems best to ensure this can't break the viewer indeed; thanks! |
sync-pdfs-for-pdf-js Bot
pushed a commit
to mozilla/pdf.js.refs
that referenced
this pull request
Oct 13, 2026
This was referenced Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If permissions are enabled and the
getPermissionsAPI-method somehow rejects, the viewer would fail to initialize and nothing would be rendered.Note: This is based solely on code inspection, and it's similar to how we ignore errors elsewhere in the viewer:
pdf.js/web/app.js
Lines 1681 to 1691 in 6c71c0b