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
Christian Tillmanns on Meeeeeeeeeeep at 08:41
Wolfgang Siebeck on Nokia Belle is available at 05:58
Ingo Martinz on Meeeeeeeeeeep at 22:32
Axel Koerv on Meeeeeeeeeeep at 21:57
Roland Dressler on Outlook to Notes converter: from PST to NSF at 11:50
Karl Heindel on Outlook to Notes converter: from PST to NSF at 10:30
Jerry Preissler on LibreOffice vs Apache OpenOffice at 13:47
Mariano Kamp on How to commit at 09:41
Bernd Vellguth on Outlook to Notes converter: from PST to NSF at 02:05
Thilo Hamberger on Outlook to Notes converter: from PST to NSF at 16:40
Jens Bruntt on Free PlayBook for your Android app submission at 11:47
Karl Heindel on Outlook to Notes converter: from PST to NSF at 20:26
Roland Dressler on Outlook to Notes converter: from PST to NSF at 15:12
Stephan H. Wissel on heise online: IBM plant Stellenabbau in Deutschland at 08:38
Jan Lauer on heise online: IBM plant Stellenabbau in Deutschland at 04:13
Juergen Heinrich on Balance at 03:29
Jörg Hermann on Girls On Longboards at 02:42
Stephan H. Wissel on heise online: IBM plant Stellenabbau in Deutschland at 23:21
Joerg Michael on heise online: IBM plant Stellenabbau in Deutschland at 21:01
Ben Poole on Outlook to Notes converter: from PST to NSF at 19:46
David Hablewitz on BlackBerry Business Cloud Services with Microsoft Office 365 at 16:44
Patrick Picard on RIM tries to be social. Falls flat on face. at 16:00
Volker Weber on Outlook to Notes converter: from PST to NSF at 10:29
Richard Hogan on Outlook to Notes converter: from PST to NSF at 10:26
Joachim Haydecker on Girls On Longboards at 08:26


