I need to know all options to disable the native Firefox Print Dialog on a Website.
Assume the Stack Exchange don’t like that the users are able to print the privacy policy by the File > Print option.
Therefore it should be possible to add JavaScript that deactivates this option.
Something similar to the technique some websites are using to "disable" right-clicks on images.
Is this possible?
More Background:
It’s not the case that i like to do it. I have to validate that my customers are not doing ugly stuff like this on their websites (more then 1000 websites).
It is absolutely not possible with JavaScript to access such things – the Print-Dialog is native and not to be disabled. Even if it were possible, one could just disable JavaScript.
A much better alternative is to use CSS. Most browser apply the
printstylesheets when they are to print the current page, so you could include something like:Of course one could remove that CSS code from the DOM, or just take a screenshot of his browser etc. Whatever files you send a user to view, he will be able to save them – you can’t prevent that. Your only possibility is to build a proprietary reader/viewer for your encoded contents to constrain the user (which could get hacked, too), but that is no option on the open web.