1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00
pdf.js/web
Jonas Jenwald 1f9d1f3696 [Firefox] Disable the ability to change preferences directly from the viewer
Please note that we've never had any functionality in the viewer itself that *set* preferences, and we've thus only ever read them.
For the GENERIC viewer it obviously makes sense for the user to be able to modify preferences, e.g. via the console, but that doesn't really apply to the *built-in* Firefox PDF Viewer since preferences are already accessible via `about:config` there. Hence it does seems somewhat strange to expose, a limited part of, the Firefox preference system in this way when we're not even using it.

Note that the unused preference setting-code also include a fair amount of *additional* validation on the platform-side, such as limiting any possible preference changes to the `pdfjs.`-branch and also an explicit white-list of preference names[1], to make sure that this is safe; please see:
 - https://searchfox.org/mozilla-central/rev/4e8f62a231e71dc53eb50b6d74afca21d6b254e9/toolkit/components/pdfjs/content/PdfStreamConverter.sys.mjs#458-495
 - https://searchfox.org/mozilla-central/rev/4e8f62a231e71dc53eb50b6d74afca21d6b254e9/toolkit/modules/AsyncPrefs.sys.mjs#21-48

Assuming that this patch lands, I'll follow-up with a mozilla-central patch to remove the code mentioned above.

---
[1] This hard-coded list contains preferences that no longer exist, and also at least one (fairly obvious) typo.
2023-06-21 20:14:16 +02:00
..
images [GeckoView] Add a button to download and open the file in an external app (bug 1829367) 2023-05-05 15:52:15 +02:00
.gitignore Remove obselete file from .gitignore 2015-01-26 16:44:45 +01:00
annotation_editor_layer_builder.css Introduce some :is usage in the debugger CSS 2023-04-19 20:47:57 +02:00
annotation_editor_layer_builder.js [Editor] Connect then annotation layer and the editor one 2023-06-05 14:05:52 +02:00
annotation_editor_params.js Reduce duplication when dispatching the "switchannotationeditorparams" event 2023-04-03 09:05:07 +02:00
annotation_layer_builder.css [api-minor] Make the popup independent of their associated annotations 2023-06-20 15:30:39 +02:00
annotation_layer_builder.js [api-minor] Move the l10n-translation into the AnnotationLayer 2023-06-20 20:28:35 +02:00
app.js Enable the unicorn/prefer-optional-catch-binding ESLint plugin rule 2023-06-12 11:46:11 +02:00
app_options.js [api-minor] Use a local font or fallback on an embedded one (if it exists) for non-embedded fonts (bug 1766039) 2023-05-10 14:10:23 +02:00
base_tree_viewer.js Use modern DOM methods a bit more (PR 15031 follow-up) 2022-06-13 10:47:37 +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 Enable the unicorn/prefer-optional-catch-binding ESLint plugin rule 2023-06-12 11:46:11 +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 Introduce some :is usage in the debugger CSS 2023-04-19 20:47:57 +02:00
debugger.js Prevent the debugger from breaking on unbalanced save/restore OPS (issue 15767) 2022-12-01 15:43:17 +01:00
download_manager.js [GeckoView] Add a button to download and open the file in an external app (bug 1829367) 2023-05-05 15:52:15 +02:00
event_utils.js Don't use the deprecated CustomEvent.initCustomEvent method anymore 2023-04-23 15:41:02 +02:00
firefox_print_service.js Convert FirefoxPrintService and PDFPrintService into standard classes 2023-04-14 10:02:28 +02:00
firefoxcom.js [Firefox] Disable the ability to change preferences directly from the viewer 2023-06-21 20:14:16 +02:00
generic_scripting.js [JS] Use beforeinput event to trigger a keystroke event in the sandbox 2022-01-23 19:53:01 +01:00
genericcom.js Remove the unused DefaultExternalServices.createDownloadManager options (PR 12191 follow-up) 2022-12-03 12:52:36 +01:00
genericl10n.js Fix broken/missing JSDocs and typedefs, to allow updating TypeScript to the latest version (issue 14342) 2021-12-15 23:14:25 +01:00
grab_to_pan.js Enable the unicorn/prefer-optional-catch-binding ESLint plugin rule 2023-06-12 11:46:11 +02:00
interfaces.js Introduce a "thumbnailrendered" event to simplify cleanup after thumbnail rendering (PR 12613 follow-up) 2023-05-26 15:30:22 +02:00
l10n_utils.js [api-minor] Ensure that the AnnotationLayer gets a default l10n-instance in GENERIC builds (PR 16552 follow-up) 2023-06-20 20:28:29 +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 Change the createPromiseCapability helper function into a PromiseCapability class 2023-04-29 13:43:24 +02:00
pdf_attachment_viewer.js Stop trying to sort the attachments in the sidebar 2023-05-21 09:54:24 +02:00
pdf_cursor_tools.js [GeckoView] Reduce the size of the *built* viewer 2023-02-05 14:12:32 +01:00
pdf_document_properties.js Change the createPromiseCapability helper function into a PromiseCapability class 2023-04-29 13:43:24 +02:00
pdf_find_bar.js Reduce some duplication when toggling "expanded" buttons in the viewer toolbars 2023-05-11 12:04:14 +02:00
pdf_find_controller.js Re-factor the isPageVisible-handling in the find-controller (PR 10217 follow-up) 2023-05-26 13:59:39 +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 Tweak the pdfOpenParams parameter, in the "updateviewarea" event, in PresentationMode 2022-04-05 14:13:20 +02:00
pdf_layer_viewer.js [api-minor] Add basic support for the SetOCGState action (issue 15372) 2022-09-01 17:34:24 +02:00
pdf_link_service.js Enable the unicorn/prefer-optional-catch-binding ESLint plugin rule 2023-06-12 11:46:11 +02:00
pdf_outline_viewer.js Enable the unicorn/prefer-optional-catch-binding ESLint plugin rule 2023-06-12 11:46:11 +02:00
pdf_page_view.js [Editor] Connect then annotation layer and the editor one 2023-06-05 14:05:52 +02:00
pdf_presentation_mode.js Enable the unicorn/prefer-optional-catch-binding ESLint plugin rule 2023-06-12 11:46:11 +02:00
pdf_print_service.js Don't use the deprecated CustomEvent.initCustomEvent method anymore 2023-04-23 15:41:02 +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.js Enable the unicorn/prefer-optional-catch-binding ESLint plugin rule 2023-06-12 11:46:11 +02:00
pdf_sidebar.js Re-factor updating of thumbnails in the PDFSidebar-class 2023-05-28 17:54:34 +02:00
pdf_single_page_viewer.js Remove the abstract BaseViewer-class 2022-09-08 12:38:17 +02:00
pdf_thumbnail_view.js Introduce a "thumbnailrendered" event to simplify cleanup after thumbnail rendering (PR 12613 follow-up) 2023-05-26 15:30:22 +02:00
pdf_thumbnail_viewer.js Introduce a "thumbnailrendered" event to simplify cleanup after thumbnail rendering (PR 12613 follow-up) 2023-05-26 15:30:22 +02:00
pdf_viewer.component.js [api-minor] Remove the xfaLayerFactory in the viewer 2022-12-18 13:26:54 +01:00
pdf_viewer.css Allow text-selection, but not copying, when enablePermissions is set (PR 16320 follow-up) 2023-04-25 11:07:05 +02:00
pdf_viewer.js Limit some PDFRenderingQueue-related code to the GENERIC viewer 2023-05-30 21:24:19 +02: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 [Firefox] Disable the ability to change preferences directly from the viewer 2023-06-21 20:14:16 +02:00
print_utils.js Enable the unicorn/prefer-dom-node-append ESLint plugin rule 2022-06-12 13:07:03 +02:00
secondary_toolbar.js Reduce some duplication when toggling "expanded" buttons in the viewer toolbars 2023-05-11 12:04:14 +02:00
struct_tree_layer_builder.js Hide the struct tree layer during zooming 2023-02-07 15:33:01 +01:00
stubs-geckoview.js [GeckoView] Remove the Toolbar-stub since the viewer has an actual toolbar now 2023-05-24 12:31:27 +02:00
text_accessibility.js Move binarySearchFirstItem back to the web/-folder (PR 15237 follow-up) 2022-08-14 11:38:17 +02:00
text_highlighter.js [api-minor] Don't normalize the text used in the text layer. 2023-04-17 14:31:23 +02:00
text_layer_builder.css Don't include Chrome-specific CSS rules in MOZCENTRAL builds 2023-04-20 14:14:33 +02:00
text_layer_builder.js Allow text-selection, but not copying, when enablePermissions is set (PR 16320 follow-up) 2023-04-25 11:07:05 +02:00
toolbar-geckoview.js [GeckoView] Add some telemetry for the toolbar buttons (bug 1829216) 2023-05-22 16:43:09 +02:00
toolbar.js Reduce some duplication when toggling buttons in the viewer toolbars 2023-04-13 13:18:37 +02:00
ui_utils.js Reduce some duplication when toggling "expanded" buttons in the viewer toolbars 2023-05-11 12:04:14 +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 [GeckoView] Add a Nimbus experiment for the toolbar (bug 1833093) 2023-05-15 17:18:14 +02:00
viewer-geckoview.html [Editor] Improve curve smoothing for Ink tool (bug 1789443) 2023-05-23 17:15:21 +02:00
viewer-geckoview.js [GeckoView] Add a button to download and open the file in an external app (bug 1829367) 2023-05-05 15:52:15 +02: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 Convert the existing overlays to use <dialog> elements (issue 14698) 2022-03-28 11:36:29 +02:00
viewer-snippet-firefox-extension.html Remove <base> tag from the Firefox built-in viewer (bug 1821408) 2023-03-14 10:12:42 +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 Simplify the thumbnail styling in the viewer 2023-05-04 12:17:49 +02:00
viewer.html [Editor] Improve curve smoothing for Ink tool (bug 1789443) 2023-05-23 17:15:21 +02:00
viewer.js Move the sidebar-resizing handling into the PDFSidebar class 2023-05-12 10:00:12 +02:00
xfa_layer_builder.css Introduce some :is usage in the xfaLayer CSS 2023-04-17 23:32:04 +02:00
xfa_layer_builder.js Change the XfaLayerBuilder.render method to be asynchronous 2022-12-11 13:08:23 +01:00