February 15, 2006
UPDATE: This article was written over a decade ago. I haven’t tested whether this technique still works in Firefox (or any other browser with a similar setting). Use at your own risk. If you truly need this functionality, you’ll need to find out which version of Firefox was available back in early 2006 and follow these instructions.
Imagine the horrific screams of Internet users world-wide as their printers start spewing coupons and ads from their printer without warning, and without the precious print dialog box to “cancel” the print process.
As it turns out, using
a user needs to do is click the
OK button and their printer will spit out a copy of that web page content.
Web browsers use this dialog box ‘halt’ to protect users from silently printing things in the background simply by visiting a web page. But what if you have a legitimate use-case, such as running a web-based Point-Of-Sale system through a browser, and you really do need to automatically print something (like a receipt) when a page contains a window.print() call?
In Firefox, clear out the address bar if it’s not already blank, and type this where you’d otherwise type in a URL like www.google.com:
This will bring up all kinds of configuration settings about the browser.
On the page with all of these configuration options, right-click on the list of options, select
Boolean – this is important, you MUST choose a Boolean type, not string or integer. The name of
the setting is this:
When you click the OK button, Firefox will prompt you to select the true or false value. Select
The modification gets written into your preferences file immediately, and now every page you visit with
a window.print() call will spew paper out of your printer like a baby who doesn’t like mushed spinach.
To turn the feature back off, you can just double-click the new setting in the
If you can’t find it, just use the “Filter:” box, and type the word
silent as the search option and
hit Enter, and that should locate it.
I’ve tested this on Ubuntu/Debian and Firefox 1.0.7. Feel free to comment back on this if you’ve tested this on other OS’s or versions of Firefox. You can even build an auto-printing page to see it in action:
Other things worth noting:
- If you misspell the new option name, I don’t believe Firefox can delete the key for you – you may need to
manually (and carefully) edit your preferences file in a text editor. The file you’ll edit is called
- Likewise, if you don’t choose a Boolean value (I tried a ‘string’ value first), you must also manually (and carefully) modify your preferences file.
- Make sure you have a working printer set up and available to Firefox, otherwise this won’t work at all. You may get other print configuration warnings or no printer output.