Disabling the ability to print to a PDF in the printer dialog
I have been working on a locked down version of Firefox, and through userChrome.css and mozilla.cfg, I have been able to do get it where it behaves mostly as intended. We are looking for a way to disable the ability to print to PDF within the print dialog in Firefox. There are concerns about the ability to access the dropdown selections within the save as dialogs, that could allow users to access files they should not have access. We don't want to outright disable the ability to print, as printing to a real printer does not cause any issues. Is it possible through the mozilla.cfg or userChrome.css to remove the option to save as a PDF from the Firefox printer dialog?
Thanks for your help!
All Replies (5)
You can avoid the Mozilla Save to PDF printer by switching to the system print dialog, go to about:config and change print.prefer_system_dialog to true.
WARNING from the moderator team: Changing Firefox preferences from the about:config page can sometimes break Firefox or cause strange behavior. You should only do this if you know what you're doing. Please read Firefox Advanced Customization and Configuration Options to learn more.
Muudetud
While true, your answer would get rid of the Mozilla option, it would still leave the system default one. It is easy enough to remove from Windows, but Linux does not seem to have a super easy way of restricting it, hence why I was hoping for a way to handle it within Firefox, rather than at the system level.
Appreciate the response though.
As of my last update in September 2021, there isn't a direct way to remove the "Save as PDF" option in Firefox's print dialog using mozilla.cfg or userChrome.css. To address security concerns, consider user access restrictions, printer policies, third-party tools, or potentially building a custom Firefox version. For the latest solutions, check Mozilla's documentation or community support.
Even if you blocked "Save to PDF", the user can still Save As other ways (Ctrl+S). On GNOME you can disable it by changing /org/gnome/desktop/lockdown/disable-save-to-disk to true but the user can still Open files (Ctrl+O).
Firefox 124 will allow blocking file dialogs with the AllowFileSelectionDialogs enterprise policy.