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

Volker Weber on Apple product launches leaked at 21:07
Matthias Lorz on Apple product launches leaked at 21:07
Matthias Lorz on Apple product launches leaked at 21:05
Ingo Seifert on Some of my playlists at 19:21
Jean Pierre Wenzel on Some of my playlists at 18:24
Oliver Schult on Neato Botvac D7 Connected :: Louie saugt at 14:31
Mathias Ziolo on And the best sounding earbuds are ... at 09:21
Volker Weber on And the best sounding earbuds are ... at 07:33
Mariano Kamp on And the best sounding earbuds are ... at 01:33
Volker Weber on The big challenge #dontbreakthechain at 19:13
Armin Auth on The big challenge #dontbreakthechain at 13:31
Thomas Nowak on The big challenge #dontbreakthechain at 12:43
Armin Auth on The big challenge #dontbreakthechain at 11:12
Thomas Nowak on The big challenge #dontbreakthechain at 08:25
Hans Giesers on The big challenge #dontbreakthechain at 23:14
Michael Sampson on The big challenge #dontbreakthechain at 03:54
Stefan Niemeier on The big challenge #dontbreakthechain at 22:29
Stefan Hempel on Poly EagleEye Cube :: Kamera mit Verfolger at 10:24
Volker Weber on Stuff that works :: Jabra Elite Active 75t at 08:16
John Keys on Stuff that works :: Jabra Elite Active 75t at 20:06
Daniel Kirstenpfad on Stuff that works :: Jabra Elite Active 75t at 19:33
Hilbert Trekel on Stuff that works :: Jabra Elite Active 75t at 18:27
Tobias Hauser on Eve Aqua :: Wenn es regnet, nicht bewässern at 15:31
Volker Weber on Stuff that works :: Jabra Elite Active 75t at 08:10
Matt Ritscher on Stuff that works :: Jabra Elite Active 75t at 07:54

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 22:55

visitors.gif

Paypal vowe