pdf.js/web
Jonas Jenwald 1cf9405281 [api-minor] Remove the closure from the PDFWorker class, in the src/display/api.js file
This patch removes the only remaining closure in the `src/display/api.js` file, utilizing a similar approach as used in lots of other parts of the code-base, which results in a small decrease in the size of the *build* `pdf.js` file.

Given that `PDFWorker` is exposed through the *public* API, this complicates things somewhat since there's a couple of worker-related properties that really should stay *private*. Initially, while working on PR 13813, I believed that we'd need support for private (static) class fields in order to get rid of this closure, however I've managed to come up with what's hopefully deemed an acceptable work-around here.
Furthermore, some helper functions were simply moved into the `PDFWorker` class as static methods, thus simplifying the overall implementation (e.g. we don't need to manually cache the Promise in the `PDFWorker._setupFakeWorkerGlobal`-method).

Finally, as part of this re-factoring a number of missing JSDoc-comments were added which *together* with the removal of the closure significantly improves the `gulp jsdoc` output for the `PDFWorker` class.

*Please note:* This patch is tagged with `api-minor` since it deprecates `PDFWorker.getWorkerSrc()` in favor of the shorter `PDFWorker.workerSrc`, with the fallback limited to `GENERIC` builds.
2021-08-07 10:43:39 +02:00
..
images Add an icon for the "find/highlight the current outlineItem" functionality 2021-01-09 16:09:46 +01:00
.gitignore Remove obselete file from .gitignore 2015-01-26 16:44:45 +01:00
annotation_layer_builder.css Annotation & XFA: Add focus outlines on different fields (bug 1723615, bug 1718528) 2021-08-05 13:33:46 +02:00
annotation_layer_builder.js Collect all l10n fallback strings, used in the viewer, in one helper function (PR 12981 follow-up) 2021-03-04 11:34:51 +01:00
app_options.js [CRX] Use dark theme by default in Chrome extension 2021-08-01 19:37:49 +02:00
app.js [api-minor] Remove the closure from the PDFWorker class, in the src/display/api.js file 2021-08-07 10:43:39 +02:00
base_tree_viewer.js Add support for finding/highlighting the outlineItem, corresponding to the currently visible page, in the sidebar (issue 7557, bug 1253820, bug 1499050) 2021-01-09 16:09:44 +01:00
base_viewer.js Update the Annotation --zoom-factor CSS variable when PDFPageView is used standalone (PR 13868 follow-up) 2021-08-05 11:43:43 +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 Account for formatting changes in Prettier version 2.3.0 2021-05-16 11:44:05 +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.js Enable the ESLint operator-assignment rule 2021-07-04 12:57:45 +02:00
download_manager.js Move the compatibilityParams into the web/app_options.js file 2021-07-27 16:44:49 +02:00
firefox_print_service.js Move the getXfaHtmlForPrinting helper function to its own file (PR 13411 follow-up) 2021-06-23 08:17:58 +02:00
firefoxcom.js Collect all l10n fallback strings, used in the viewer, in one helper function (PR 12981 follow-up) 2021-03-04 11:34:51 +01:00
generic_scripting.js Account for formatting changes in Prettier version 2.3.0 2021-05-16 11:44:05 +02:00
genericcom.js Pass in the "sandboxBundleSrc" option when calling DefaultExternalServices.createScripting 2020-12-23 14:05:49 +01:00
genericl10n.js [GENERIC viewer] Try to fixup "incomplete" language codes (issue 13689) 2021-07-08 12:54:58 +02:00
grab_to_pan.js [GrabToPan] Use Element.matches() rather than prefixed ...matchesSelector versions 2021-03-26 21:37:51 +01:00
interfaces.js Add support for basic structure tree for accessibility. 2021-04-09 09:56:28 -07:00
l10n_utils.js [GENERIC viewer] Try to fixup "incomplete" language codes (issue 13689) 2021-07-08 12:54:58 +02:00
overlay_manager.js Fix the linting errors, from the Prettier auto-formatting, that ESLint --fix couldn't handle 2019-12-26 12:35:12 +01:00
password_prompt.js Collect all l10n fallback strings, used in the viewer, in one helper function (PR 12981 follow-up) 2021-03-04 11:34:51 +01:00
pdf_attachment_viewer.js [api-minor] Support the Content-Disposition filename in the Firefox PDF Viewer (bug 1694556, PR 9379 follow-up) 2021-02-26 10:50:29 +01:00
pdf_cursor_tools.js Remove the useless PresentationModeState.CHANGING-case in PDFCursorTools (PR 12788 follow-up) 2021-02-14 10:39:49 +01:00
pdf_document_properties.js Move the getPdfFilenameFromUrl helper function from web/ui_utils.js and into src/display/display_utils.js 2021-03-17 15:48:24 +01:00
pdf_find_bar.js Collect all l10n fallback strings, used in the viewer, in one helper function (PR 12981 follow-up) 2021-03-04 11:34:51 +01:00
pdf_find_controller.js Take the position of the selected element into account when scrolling matches (issue 13596) 2021-06-21 11:49:33 +02:00
pdf_find_utils.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
pdf_history.js Change the parseQueryString function to return a Map rather than an Object (issue 13829) 2021-07-31 23:24:49 +02:00
pdf_layer_viewer.js Account for formatting changes in Prettier version 2.3.0 2021-05-16 11:44:05 +02:00
pdf_link_service.js Change the parseQueryString function to return a Map rather than an Object (issue 13829) 2021-07-31 23:24:49 +02:00
pdf_outline_viewer.js Replace instanceof Object with typeof checks 2021-07-03 11:30:46 +02:00
pdf_page_view.js Update the Annotation --zoom-factor CSS variable when PDFPageView is used standalone (PR 13868 follow-up) 2021-08-05 11:43:43 +02:00
pdf_presentation_mode.js Remove the deprecated properties from the "presentationmodechanged" event (PR 12788 follow-up) 2021-04-06 13:04:23 +02:00
pdf_print_service.js Move the compatibilityParams into the web/app_options.js file 2021-07-27 16:44:49 +02:00
pdf_rendering_queue.js Update the Annotation --zoom-factor CSS variable when PDFPageView is used standalone (PR 13868 follow-up) 2021-08-05 11:43:43 +02:00
pdf_scripting_manager.js Ensure that PDFScriptingManager.setDocument handles failure when initializing the scripting-factory 2021-06-17 18:42:15 +02:00
pdf_sidebar_resizer.js Use more optional chaining in the web/-folder (PR 12961 follow-up) 2021-03-07 16:20:52 +01:00
pdf_sidebar.js Improve the handling of the currentOutlineButton enabling/disabling (PR 12777 follow-up) 2021-04-10 13:12:47 +02:00
pdf_single_page_viewer.js Add previous/next-page functionality that takes scroll/spread-modes into account (issue 11946) 2021-01-22 21:38:15 +01:00
pdf_thumbnail_view.js Account for formatting changes in Prettier version 2.3.0 2021-05-16 11:44:05 +02:00
pdf_thumbnail_viewer.js Remove the disableCanvasToImageConversion functionality from PDFThumbnailView (PR 7029 follow-up) 2021-05-09 14:26:01 +02:00
pdf_viewer.component.js [api-minor] Move the viewer scripting initialization/handling into a new PDFScriptingManager class 2021-03-05 20:31:48 +01:00
pdf_viewer.css Annotation & XFA: Scale the font size in choicelist using zoom factor (bug 1715996) 2021-08-04 20:36:04 +02:00
pdf_viewer.js Add previous/next-page functionality that takes scroll/spread-modes into account (issue 11946) 2021-01-22 21:38:15 +01:00
pdfjs.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
preferences.js Remove some *indirect* loops in the BasePreferences.getAll-method 2021-03-22 14:38:05 +01:00
print_utils.js [api-minor] Add a new getXfaPageViewport helper function to support printing 2021-06-23 08:17:58 +02:00
secondary_toolbar.js fix(a11y): resolve sidebar, find, toolbar missing aria-expanded and 2021-02-05 16:08:29 -08:00
struct_tree_layer_builder.js Add support for basic structure tree for accessibility. 2021-04-09 09:56:28 -07:00
text_layer_builder.css Visually hide br in text selections 2021-08-01 19:42:05 +02:00
text_layer_builder.js Take the position of the selected element into account when scrolling matches (issue 13596) 2021-06-21 11:49:33 +02:00
toolbar.js Remove focus from the zoom dropdown, when a mouse is used (bug 1300525, issue 4923) 2021-05-20 15:28:38 +02:00
ui_utils.js Implement unit tests for the parseQueryString utility function 2021-08-01 14:14:33 +02:00
view_history.js Add a bit more validation in the ViewHistory constructor 2020-03-21 13:55:06 +01:00
viewer-snippet-chrome-extension.html Wraps mozL10n to async calls; splits firefox and generic l10n libs. 2017-05-31 09:22:25 -05:00
viewer-snippet-chrome-overlays.html [CRX] Add file chooser as fallback (fixes #9411) 2018-03-21 18:21:46 +01:00
viewer-snippet-firefox-extension.html Stop bundling the ReadableStream polyfill in MOZCENTRAL builds (PR 10470 follow-up) 2019-01-23 20:33:20 +01:00
viewer-snippet-minified.html Remove XHTML leftovers from the viewer HTML files 2016-02-14 13:23:34 +01:00
viewer-snippet.html Wraps mozL10n to async calls; splits firefox and generic l10n libs. 2017-05-31 09:22:25 -05:00
viewer.css XFA - Page can be too small when printing (bug 1723705) 2021-08-03 15:07:33 +02:00
viewer.html Remove <meta> tag only necessary for IE-compatibility 2021-07-15 13:59:40 +02:00
viewer.js Stop including the "errorWrapper" HTML code in MOZCENTRAL-builds 2021-02-14 10:39:34 +01:00
xfa_layer_builder.css Annotation & XFA: Add focus outlines on different fields (bug 1723615, bug 1718528) 2021-08-05 13:33:46 +02:00
xfa_layer_builder.js [api-minor] Add a new getXfaPageViewport helper function to support printing 2021-06-23 08:17:58 +02:00