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

Reinhardt von Bergen Wedemeyer on Auf den Hund gekommen: Apple AirTags im Praxistest at 13:36
Bastian Anthon on Auf den Hund gekommen: Apple AirTags im Praxistest at 13:28
Frank Quednau on Auf den Hund gekommen: Apple AirTags im Praxistest at 12:39
Reinhardt von Bergen Wedemeyer on Auf den Hund gekommen: Apple AirTags im Praxistest at 12:06
Sascha Bleidner on Firmware Updates for Jabra Evolve2 65, Link 380 and Link 370 at 10:44
Peter Meuser on Firmware Updates for Jabra Evolve2 65, Link 380 and Link 370 at 08:07
Manfred Wiktorin on Ein paar Gedanken zum Apple Spring Event at 15:05
Karl Heindel on Ein paar Gedanken zum Apple Spring Event at 14:39
Patrick Bohr on Ein paar Gedanken zum Apple Spring Event at 11:11
Philipp Hügelmeyer on Ein paar Gedanken zum Apple Spring Event at 10:22
Marko Schulz on Ein paar Gedanken zum Apple Spring Event at 21:51
Axel Borschbach on Ein paar Gedanken zum Apple Spring Event at 11:09
Volker Weber on Ein paar Gedanken zum Apple Spring Event at 10:42
Peter Daum on Ein paar Gedanken zum Apple Spring Event at 10:24
Friedrich Holstein on Ein paar Gedanken zum Apple Spring Event at 10:21
Reinhard Fellner on Ein paar Gedanken zum Apple Spring Event at 10:20
Friedrich Holstein on Ein paar Gedanken zum Apple Spring Event at 10:18
Peter Meuser on Ein paar Gedanken zum Apple Spring Event at 10:11
Hubert Stettner on Firmware Updates for Jabra Evolve2 65, Link 380 and Link 370 at 09:51
Volker Weber on Ein paar Gedanken zum Apple Spring Event at 09:11
Peter Meuser on Ein paar Gedanken zum Apple Spring Event at 09:09
Volker Weber on Firmware Updates for Jabra Evolve2 65, Link 380 and Link 370 at 08:58
Hubert Stettner on Firmware Updates for Jabra Evolve2 65, Link 380 and Link 370 at 08:57
Hubert Stettner on Firmware Updates for Jabra Evolve2 65, Link 380 and Link 370 at 08:56
Mathias Ziolo on Ein paar Gedanken zum Apple Spring Event at 08:34

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 13:44

visitors.gif

Paypal vowe