I’m sure you can imagine the horrific screams of people as their printers started spewing coupons, ads, etc. from their printer while surfing a web site without the precious print dialog box to ‘cancel’ printing things automatically. But as i…

I’m sure you can imagine the horrific screams of people as their printers started spewing coupons, ads, etc. from their printer while surfing a web site without the precious print dialog box to ‘cancel’ printing things automatically. But as it turns out, using
window.print()
in a JavaScript call, can open a print dialog box for a given web page … simply click the OK box, and your printer will spit out a copy of the web page you’re currently browsing.By using this dialog box, web browsers protect users from silently printing things in the background simply by visiting a web page, but what if you run Point-Of-Sale software on a system through a browser, and you WANT to automatically print something when a page contains a window.print() call?

In Firefox, hit CTRL-T to open a new tab so you can keep reading this, 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:
about:config
This will bring up all kinds of configuration settings about the browser.

Now, by default, Firefox wants to protect you SO badly from automated printing, that they don’t even include the option here for you to toggle. After browsing the source code for Firefox over my lunch hour (hey, a geek’s gotta feed his mind too), I found a setting that will do the trick – it shuts off the print dialog box, and will automagically print a page containing a window.print() javascript call.

So on the page with all of these configuration options, simply right-click on the list of options, select ‘New’ and choose ‘Boolean’ — this is important, you MUST choose a Boolean type, not string or integer. The name of the setting is this:
print.always_print_silent

When you click the OK button, it will prompt you to select the true or false value. Select "true". Voila … instant change. The moficiation gets written into your preferences file, 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 it in the about:config list. If you can’t find it, just use the "Filter:" box, and type the word ‘silent’ as the search option and hit ENTER, and it 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:

<html>
<head>
<title>Ian was here</title>
</head>
<body>
This is my auto-printing page!
</body>
<script type="text/javascript">
window.print() ;
</script>
</html>

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.
  • 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. Leave a comment here if you don’t know here your prefs.js file is and I’ll see if I can help you track it down.
  • if you get other print configuration warnings and no printer output, then you should check your other printer settings in Firefox to ensure they’re set up properly.

When Elizabeth and I started dating ‘forever’ ago, she forced convinced me to listen to her favorite Beatles CD, and had made some quip about the age 64. I had no idea what she was going on about until the clarinet started … “When I get older, losing my hair …” egad. Instant reinforcement that I would *forever* hate the Beatles.

Skip ahead to last August. We’d had a good deal of people asking us if we were going to have dancing at our reception at the September wedding. For various reasons, including wanting a quick escape since we’d only booked off two days for a honeymoon, we nixxed the idea of a dance. But I decided I’d be clever and play “When I’m 64″ and get Elizabeth up to dance one dance with me. In order to quell my gut-wrenching hatred of that “sick moose calf” sound of a clarinet, I played the song over and over and over and OVER, memorizing the lyrics all the while which cracked her up when I started singing it while trying to dance too. And did a so-so job at both ;o)

Well, the dance came off as a big hit with everyone else, especially the baby-boomers who grew up on the song, and it cemented our love and devotion to each other for the next 33 years until I turn 64. Coincidentally, my parents had been married 33 years as of our own wedding date, and my dad turned 64 a month ago on January 13th.

So … not to be outdone by the boys from England, who are still waiting on Paul McCartney so they can start the long-awaited “Cloud Nine Tour of Heaven”, here’s my geeky version of “When I’m 64″:

When I get older, losing my hair, from the pills I’m on,
Will you still be surfing on the Internet,
wond’ring if dooce’s Leta’s grown up yet?
If you still can’t find my MP3’s, or deal with NetFlix
Will I be geeky, will your glasses be streaky,
When I’m 2^6?

You’ll be forty-two. (at least that’s what we’ll tell people)
And if you still use Word, I won’t have a clue.

Emails of v1@gra, ciallis and more, SpamAssassin’s gone!
but I’ll be writing more rules for the firewall,
and HotWire tickets to Montreal.
Building a web page, Digg’ing some news, with hardware conflicts…
Will I be geeky? Will Windoze be tweaky,
When I’m 2^6?

Every summer we can rent a laptop
with a Pentium III, if it’s not too slow.
takes … too … long … to … save.
Grandchildren on your knee:
Willie, Chuck, and Dave.

Send me an IM, use Vonage or Skype, or using IRC.
torrent all the photos that you’re trying to share,
all that bandwidth, without a care.
Close all the pop-ups, fill in a form, with Google’s back of tricks
Will i be geeky, or just old and creaky,
When I’m 2^6?

I can’t tell you how many Emails I get from people that seek my trustworthiness and absolute secrecy to transfer millions of dollars to the US from various African countries like Nigeria. Today I got a new spin on it – someone claiming to be …

I can’t tell you how many Emails I get from people that seek my trustworthiness and absolute secrecy to transfer millions of dollars to the US from various African countries like Nigeria. Today I got a new spin on it – someone claiming to be skimming money from a money market fund, and looking for someone to split the money with 60-40 if they’ll front as an investor to get the money:

I am Mr.Glyn Jones,Funds Manager of Fidelity Investment International.The World Largest Funds Management Company with over $1.2Trillion Capital Investment Funds.Neverthless, as Fidelity Funds Manager, I handle all our Investor’s Direct Capital Funds and secretly extract 1.2% Excess Maximum Return Capital Profit (EMRCP) per annum on each of the Investor’s Magellan Capital Funds. As an expert,I have made over $22.4m from the Investor’s EMRCP and hereby looking for someone to trust who will stand as an Investor to receive the funds as Annual Investment Proceeds from Fidelity Magellan Capital Funds.

All confirmable documents to back up the claims will be made available to you prior to your acceptance. Meanwhile,I have worked out the strategies and technincalities whereby the funds can be claimed in any of our 6 Clearing Houses without any hitches.Our sharing ratio will be 60-40 while 0.5% will be for expenseS during the process of the transaction. Should incase you are interested,Please email me your direct telephone number for discussion of this transaction in further details.

Sincerely.
Mr.Glyn Jones.
www.(url removed).com

Posted in Uncategorized.