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
Alper Iseri
on Want somebody's .Mac password? Just ask for it. at 20:13
Kevin Pettitt
on Want somebody's .Mac password? Just ask for it. at 19:04
Frank Quednau
on New toy: Polaroid Pogo Printer at 16:07
Haiko Hebig
on Nipple remover, the sequel at 15:50
Steffen Pelz
on Operating systems and browsers on vowe dot net at 15:44
Victor Toal
on Klare Ansage at 16:57
Gerry Shappell
on iPhone and iPod Touch wallpapers for the rest of us at 15:06
Ragnar Schierholz
on iPhone and iPod Touch wallpapers for the rest of us at 13:56
Sascha Reissner
on I dare you at 11:42
Volker Weber
on I dare you at 10:25
Sascha Reissner
on I dare you at 10:11
Bernd Webster
on I dare you at 08:48
Volker Weber
on Operating systems and browsers on vowe dot net at 23:18
Alper Iseri
on Try to watch the brunette at 22:23
Alper Iseri
on I dare you at 22:19
Jan-Piet Mens
on I dare you at 21:58
Ben Poole
on Operating systems and browsers on vowe dot net at 21:14
Rob McDonagh
on I dare you at 21:07
JOhn Mill
on I dare you at 19:56
John Head
on Operating systems and browsers on vowe dot net at 18:17
Bob Balaban
on Would you ride this? at 16:25
Bob Balaban
on I dare you at 16:23
Jocelyn Bowie
on Pearl not rolling at 19:36
Dag Kvello
on Try to watch the brunette at 13:08
Vitor Pereira
on Operating systems and browsers on vowe dot net at 12:55



