Blocking automatic print dialogs
by Volker Weber
Most of the times, print versions of web pages are much better to read. No attention-grabbing ads, just clean text on a neutral background.
These pages often come with one downside. Web designers put some Javascript into the page to open the print dialog, which you then have to close if you want to read the page.
In Firefox it is pretty easy to block this behavior. Just create user.js in your profile directory and enter this:
// block print popups from Javascript
user_pref("capability.policy.default.Window.print", "noAccess");
No more print popups.
Comments
Great tip, but as a novice, how do I create the user:js in the profile directory? Thanks
For those who don't want to search the profile directory:
- Type "about:config" as URL an hit return.
- Right-click in the config page and select "New > String" from the context menu.
- Fill in "capability.policy.default.Window.print" as the first value and "noAccess" as the second value.
- Be aware that this new setting produces a JavaScript error "Error: uncaught exception: Permission denied to get property Window.print" whenever you open a page uses the described JavaScript. Every possible script call after "window.print();" will fail!
List of user.js scripts...
Thanks, Erhardt.
I think we are better off making this setting more specific:
// block print popups from Javascript
user_pref("capability.policy.printsites.sites", "http://www.spiegel.de");
user_pref("capability.policy.printsites.Window.print", "noAccess");
For more than one site, just put more URLs into the string.
Post a comment
Recent comments
Alex Boschmans
on Nice try at 13:35
Volker Weber
on From my inbox at 12:21
Stephan H. Wissel
on From my inbox at 12:00
Karsten Lehmann
on Nice try at 01:17
Oswald Prucker
on Nice try at 00:54
Jim Boling
on Nice try at 23:24
Albert Dandl
on Nice try at 20:12
Karsten Lehmann
on Nice try at 19:18
Riza Baltazar
on Color coordination for web sites at 19:10
Sean Cull
on From my inbox at 19:00
Armin Roth
on Nice try at 18:02
Bart Severein
on From my inbox at 16:52
Hubert Stettner
on Why is Nokia such a complete failure? at 14:59
Ralf Stellmacher
on Overheard in New York at 12:47
Chris Frei
on Holy moly at 09:03
Ben Poole
on Why is Nokia such a complete failure? at 08:50
Dirk Steins
on Holy moly at 08:11
simon carter
on Why is Nokia such a complete failure? at 08:06
Ingo Seifert
on Holy moly at 05:50
Moritz Schroeder
on Why is Nokia such a complete failure? at 04:22
Mika Heinonen
on Why is Nokia such a complete failure? at 02:26
Andy Mell
on Holy moly at 00:54
Volker Weber
on Why is Nokia such a complete failure? at 00:23
Oswald Prucker
on Holy moly at 00:02
Yves Luther
on Why is Nokia such a complete failure? at 23:33


