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

Sebastian Botz on IoP – the internet of pets – predictive maintenance of a cat at 12:19
Daniel Kirstenpfad on IoP – the internet of pets – predictive maintenance of a cat at 20:41
Federico Hernandez on IoP – the internet of pets – predictive maintenance of a cat at 13:38
Steffen Nork on Dynamic Theme :: Tapetenwechsel at 12:34
Frank Köhler on Alles gut at 11:05
Ralf-Philipp Weinmann on Samsung Galaxy S10 :: Erste Eindrücke at 05:53
Ralf-Philipp Weinmann on Lenovo vs Apple laptops at 05:25
Volker Weber on Samsung in der Schepp Schachtel at 23:28
Lucius Bobikiewicz on Samsung in der Schepp Schachtel at 19:47
Volker Weber on Samsung in der Schepp Schachtel at 18:46
Jörg Weske on Samsung in der Schepp Schachtel at 18:25
Lucius Bobikiewicz on Samsung in der Schepp Schachtel at 17:44
Johannes Neubrecht on Samsung in der Schepp Schachtel at 16:23
Oliver Regelmann on The Hottest Chat App for Teens Is ... Google Docs :: The Atlantic at 15:47
Rob McDonagh on The Hottest Chat App for Teens Is ... Google Docs :: The Atlantic at 14:46
Gerhard Heeke on Dynamic Theme :: Tapetenwechsel at 10:25
Volker Weber on Dynamic Theme :: Tapetenwechsel at 20:10
Amy Blumenfield on Dynamic Theme :: Tapetenwechsel at 20:06
Volker Weber on Invoxia Triby :: Demnächst in diesem Theater at 16:21
Torben Volkmann on Invoxia Triby :: Demnächst in diesem Theater at 16:20
Volker Weber on You have to learn to live with Apple bugs at 12:00
Mike Hartmann on You have to learn to live with Apple bugs at 11:29
Peter Meuser on Headsets für Skype und Teams at 19:47
Dirk Rose on You have to learn to live with Apple bugs at 10:18
Chris Frei on Invoxia Pet Tracker :: Der Test beginnt at 08:19

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 17:15

visitors.gif

buy me coffee

Paypal vowe