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

skip brandon, 2006-10-30

Instructions

Volker Weber, 2006-10-30

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!

Christian Heindel, 2006-10-30

List of user.js scripts...

Erhardt Nel, 2006-10-30

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.

Volker Weber, 2006-10-30

Recent comments

Thomas Cloer on Yahoo, Altavista, Google. Next? at 22:03
Götz Görisch on Android One ist überbewertet at 20:52
Jochen Kattoll on Yahoo, Altavista, Google. Next? at 16:59
Manuel Fischer on Android One ist überbewertet at 13:59
Stefan Pfeiffer on Yahoo, Altavista, Google. Next? at 13:06
Thomas Cloer on Yahoo, Altavista, Google. Next? at 10:12
Ragnar Schierholz on Chredge is here at 10:06
Roland Dressler on Surface Laptop 3 :: Ein blinde Empfehlung at 10:06
Lars Berntrop-Bos on Android One ist überbewertet at 09:52
Lars Berntrop-Bos on Android One ist überbewertet at 09:14
Lars Berntrop-Bos on Android One ist überbewertet at 09:11
Martin Loeschner on Yahoo, Altavista, Google. Next? at 08:36
Ulli Mueller on Yahoo, Altavista, Google. Next? at 00:05
Axel Laemmert on Yahoo, Altavista, Google. Next? at 21:23
Valentin Wölm on Yahoo, Altavista, Google. Next? at 19:51
Jochen Kattoll on Android One ist überbewertet at 18:40
Ragnar Schierholz on Yahoo, Altavista, Google. Next? at 18:01
Klaus Seibold on Yahoo, Altavista, Google. Next? at 16:59
Götz Görisch on Android One ist überbewertet at 16:58
Volker Barth on Yahoo, Altavista, Google. Next? at 15:50
Torsten Pinkert on Yahoo, Altavista, Google. Next? at 15:18
Holger Meier on Yahoo, Altavista, Google. Next? at 14:52
Felix Kluge on Yahoo, Altavista, Google. Next? at 14:45
Jochen Kattoll on Yahoo, Altavista, Google. Next? at 14:43
Nina Wittich on Surface Laptop 3 :: Ein blinde Empfehlung at 14:16

Ceci n'est pas un blog

I explain difficult concepts in simple ways. For free, and for money. Clue procurement and bullshit detection.

vowe

Contact
Publications
Stuff that works
Amazon Wish List
Frequently Asked Questions

rss feed  twitter  amazon

Local time is 02:39

visitors.gif

buy me coffee

Paypal vowe