1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00
pdf.js/web
Jonas Jenwald b26dc19392 Ensure that serializing of StructTree-data cannot fail during loading
I discovered that doing skip-cache re-reloading of https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf would *intermittently* cause (some of) the AnnotationLayers to break with errors printed in the console (see below).

In hindsight this bug is really obvious, however it took me quite some time to find it, since the `StructTreePage.prototype.serializable` getter will lookup various data and all of those cases can fail during loading when streaming and/or range requests are being used.

Finally, to prevent any future errors, ensure that the viewer won't break in these sort of situations.

```
Uncaught (in promise)
Object { message: "Missing data [19098296, 19098297)", name: "UnknownErrorException", details: "MissingDataException: Missing data [19098296, 19098297)", stack: "BaseExceptionClosure@resource://pdf.js/build/pdf.mjs:453:29\n@resource://pdf.js/build/pdf.mjs:456:2\n" }
viewer.mjs:8801:55

\#renderAnnotationLayer: "UnknownErrorException: Missing data [17552729, 17552730)". viewer.mjs:8737:15

Uncaught (in promise)
Object { message: "Missing data [17552729, 17552730)", name: "UnknownErrorException", details: "MissingDataException: Missing data [17552729, 17552730)", stack: "BaseExceptionClosure@resource://pdf.js/build/pdf.mjs:453:29\n@resource://pdf.js/build/pdf.mjs:456:2\n" }
viewer.mjs:8801:55
```
2024-11-01 17:43:59 +01:00
..
images [Editor] Update the loading icon when wait for ML to take into account prefered-reduced-motion setting 2024-08-30 15:48:51 +02:00
.gitignore Remove obselete file from .gitignore 2015-01-26 16:44:45 +01:00
alt_text_manager.js Remove event listeners with AbortSignal in the AltTextManager class 2024-10-11 12:05:36 +02:00
annotation_editor_layer_builder.css [Editor] Split the long words when showing the alt-text tooltip (bug 1903588) 2024-10-28 11:08:30 +01:00
annotation_editor_layer_builder.js [Editor] Make stamp annotations editable (bug 1921291) 2024-10-03 21:54:08 +02:00
annotation_editor_params.js [Editor] Add the telemetry for the new alt text (bug 1912500) 2024-08-10 18:29:03 +02:00
annotation_layer_builder.css Disable link annotations during text selection 2024-07-23 10:42:34 +02:00
annotation_layer_builder.js [Editor] Make the stamp annotations alt text readable by either VO or NVDA (bug 1912001) 2024-09-03 16:57:41 +02:00
app.js Merge pull request #18898 from Snuffleupagus/PDFViewerApplication-bindEvents-opts 2024-10-15 20:34:45 +02:00
app_options.js Merge pull request #18594 from Snuffleupagus/rm-enableHighlightEditor-pref 2024-08-13 08:14:09 +02:00
base_tree_viewer.js Limit base-class initialization checks to development and TESTING modes 2024-08-12 12:26:35 +02:00
caret_browsing.js Update the CaretBrowsingMode toolbar-height if the toolbarDensity preference changes (PR 18786 follow-up) 2024-10-01 19:43:16 +02:00
chrome-i18n-allow-access-to-file-urls.json Add translations of "Allow access to file URLs" 2015-08-14 18:59:55 +02:00
chromecom.js [CRX] Set manifest_version to 3 2024-09-08 16:35:13 +02:00
compressed.tracemonkey-pldi-09.pdf Add Makefile. Move some files around to make building the website easier. 2011-07-05 10:53:57 -07:00
debugger.css Fix the textLayer-opacity when using the FontInspector (PR 17533 follow-up) 2024-01-26 18:31:38 +01:00
debugger.mjs [Debugger] Add some info about substitution font 2023-10-09 12:06:33 +02:00
dialog.css Fix the rendering of the different separators we've in the UI 2024-09-19 15:24:01 +02:00
download_manager.js Stop sending the unused options parameter to various download-methods in the viewer 2024-08-02 20:46:13 +02:00
draw_layer_builder.css [Editor] Correctly rotate the mask when rotation a free highlight (bug 1879102) 2024-02-08 15:29:29 +01:00
draw_layer_builder.js [Editor] Add a new editor to highlight some text in a pdf (bug 1866119) 2023-11-28 14:21:53 +01:00
event_utils.js Add the possibility to dispatch some pdf.js events at the chrome level (bug 1904585) 2024-06-25 21:03:34 +02:00
external_services.js Limit base-class initialization checks to development and TESTING modes 2024-08-12 12:26:35 +02:00
firefox_print_service.js [api-minor] Implement basic support for OptionalContent Usage dicts (issue 5764, bug 1826783) 2024-03-12 13:18:15 +01:00
firefoxcom.js [Firefox] Remove the "loadaiengineprogress" listener with AbortSignal.any() 2024-08-10 11:16:42 +02:00
generic_scripting.js Use a limit, in more places, when splitting strings 2024-02-02 13:10:52 +01:00
genericcom.js Dispatch changes in prefs enableAltTextModelDownload and enableGuessAltText to the viewer (bug 1912024) 2024-08-07 23:21:38 +02:00
genericl10n.js Only use the l10n fallback bundle when normal ftl-file fetching failed (issue 18264) 2024-06-18 11:54:49 +02:00
grab_to_pan.js Remove event listeners with AbortSignal in the GrabToPan class 2024-10-19 12:01:43 +02:00
interfaces.js Stop sending the unused options parameter to various download-methods in the viewer 2024-08-02 20:46:13 +02:00
l10n.js Don't initialize L10n.#elements eagerly since it's unused in MOZCENTRAL builds 2024-10-30 15:20:44 +01:00
new_alt_text_manager.js [Editor] Don't show the ml toggle button when the ml is disabled (bug 1920515) 2024-09-23 19:46:32 +02:00
overlay_manager.js Remove the OverlayManager.unregister method since it's completely unused 2023-06-21 13:13:53 +02:00
password_prompt.js Use "full" localization ids throughout the code-base 2024-08-31 18:31:31 +02:00
pdf_attachment_viewer.js [api-minor] Improve the FileSpec implementation 2024-05-01 18:02:05 +02:00
pdf_cursor_tools.js Ensure that the CursorTools-buttons are disabled e.g. during editing (PR 15522 follow-up) 2024-09-28 12:29:51 +02:00
pdf_document_properties.js Change how we handle l10n-args for dates in the DocumentProperties dialog (bug 1922618) 2024-10-04 19:50:05 +02:00
pdf_find_bar.js Refactor the toolbar html & css to improve its overall accessibility (bug 1171799, bug 1855695) 2024-09-23 22:43:44 +02:00
pdf_find_controller.js Consider foo-\nBar as a compound word 2024-09-11 15:01:54 +02:00
pdf_find_utils.js [api-minor] Don't normalize the text used in the text layer. 2023-04-17 14:31:23 +02:00
pdf_history.js [CRX] Remove obsolete manifest features 2024-08-25 20:34:03 +02:00
pdf_layer_viewer.js Re-factor how PDFLayerViewer decides if the UI needs to updated on "optionalcontentconfigchanged" events 2024-10-01 13:25:22 +02:00
pdf_link_service.js Allow /XYZ destinations without zoom parameter (issue 18408) 2024-07-18 13:29:32 +02:00
pdf_outline_viewer.js [api-minor] Move the page reference/number caching into the API 2024-04-29 18:54:06 +02:00
pdf_page_view.js [Editor] Make stamp annotations editable (bug 1921291) 2024-10-03 21:54:08 +02:00
pdf_presentation_mode.js Remove event listeners with signal in web/pdf_presentation_mode.js 2024-04-18 18:41:18 +02:00
pdf_print_service.js Revoke the blob-URLs used during printing in PDFPrintService 2024-08-23 18:39:28 +02:00
pdf_rendering_queue.js Limit some PDFRenderingQueue-related code to the GENERIC viewer 2023-05-30 21:24:19 +02:00
pdf_scripting_manager.component.js Use shorter arrow functions where possible 2024-01-21 10:13:12 +01:00
pdf_scripting_manager.js Remove event listeners with signal in web/pdf_scripting_manager.js 2024-04-20 12:00:58 +02:00
pdf_sidebar.js Remove the sidebar resizing event listeners with an AbortController 2024-08-10 12:24:59 +02:00
pdf_single_page_viewer.js Remove the abstract BaseViewer-class 2022-09-08 12:38:17 +02:00
pdf_thumbnail_view.js [Editor] Take into account the device pixel ratio when drawing an added image 2024-09-16 14:48:26 +02:00
pdf_thumbnail_viewer.js Add an option to enable/disable hardware acceleration (bug 1902012) 2024-06-12 18:41:07 +02:00
pdf_viewer.component.js Ensure that GenericL10n works if the locale files cannot be loaded 2024-01-31 14:07:11 +01:00
pdf_viewer.css Use the "pageColorsBackground" option as background-color for non-loaded pages (issue 18680) 2024-09-12 21:15:15 +02:00
pdf_viewer.js Remove the temporary "visibilitychange" listener, in PDFViewer, with AbortSignal.any() 2024-10-08 15:38:31 +02:00
pdfjs.js [api-minor] Remove the CMapCompressionType enumeration 2024-10-24 11:08:16 +02:00
preferences.js Limit base-class initialization checks to development and TESTING modes 2024-08-12 12:26:35 +02:00
print_utils.js Handle appending consistently in the xfaLayer regardless of rendering intent (PR 17177 follow-up) 2023-10-26 12:05:33 +02:00
secondary_toolbar.js Ensure that the CursorTools-buttons are disabled e.g. during editing (PR 15522 follow-up) 2024-09-28 12:29:51 +02:00
struct_tree_layer_builder.js Ensure that serializing of StructTree-data cannot fail during loading 2024-11-01 17:43:59 +01:00
stubs-geckoview.js [Editor] Add a new dialog for alt-text settings (bug 1909604) 2024-08-01 21:34:50 +02:00
text_accessibility.js [Editor] Add the parent tag id (if any) to the serialized editors (bug 1845087) 2023-09-07 18:22:33 +02:00
text_highlighter.js Remove event listeners with signal in web/annotation_layer_builder.js and web/text_highlighter.js 2024-04-21 09:41:21 +02:00
text_layer_builder.css Make tagged images visible for screen readers (bug 1708040) 2024-09-05 17:59:42 +02:00
text_layer_builder.js Handle null parentElement for selection anchor 2024-10-11 13:58:06 +01:00
toggle_button.css Fix the RTL-rule for the editorHighlightShowAll button, such that it works outside of the Firefox PDF Viewer 2024-04-10 11:35:04 +02:00
toolbar-geckoview.js [GeckoView] Remove the open-in-app button (bug 1832519) 2024-03-04 19:32:12 +01:00
toolbar.js Increase the size of the toolbar depending on the uidensity (bug 1171799) 2024-09-25 14:27:17 +02:00
ui_utils.js [Editor] Take into account the device pixel ratio when drawing an added image 2024-09-16 14:48:26 +02:00
view_history.js Add a bit more validation in the ViewHistory constructor 2020-03-21 13:55:06 +01:00
viewer-geckoview.css [GV] Increase the height (48px) of the toolbar in order to fit the a11y recommendations (bug 1838602) 2024-10-02 19:17:40 +02:00
viewer-geckoview.html Refactor the toolbar html & css to improve its overall accessibility (bug 1171799, bug 1855695) 2024-09-23 22:43:44 +02:00
viewer-geckoview.js Replace eslint-plugin-sort-exports by eslint-plugin-perfectionist 2024-10-20 18:50:35 +02:00
viewer-snippet-chrome-extension.html [api-minor] Move to Fluent for the localization (bug 1858715) 2023-10-19 11:20:41 +02:00
viewer-snippet-chrome-overlays.html Convert the existing overlays to use <dialog> elements (issue 14698) 2022-03-28 11:36:29 +02:00
viewer-snippet-firefox-extension.html [api-major] Output JavaScript modules in the builds (issue 10317) 2023-10-07 09:31:08 +02:00
viewer-snippet.html [api-minor] Move to Fluent for the localization (bug 1858715) 2023-10-19 11:20:41 +02:00
viewer.css Remove mask-image duplication for the print/download buttons 2024-10-20 21:15:09 +02:00
viewer.html Increase the size of the toolbar depending on the uidensity (bug 1171799) 2024-09-25 14:27:17 +02:00
viewer.js Replace eslint-plugin-sort-exports by eslint-plugin-perfectionist 2024-10-20 18:50:35 +02:00
xfa_layer_builder.css Remove unnecessary alpha-value from CSS rgb colors 2023-10-06 09:50:03 +02:00
xfa_layer_builder.js Handle appending consistently in the xfaLayer regardless of rendering intent (PR 17177 follow-up) 2023-10-26 12:05:33 +02:00