Quick Tip: Stop Auto-printing with GlimmerBlocker

As part of my high-volume web reading habits, I click through to the print versions of articles whenever possible. Annoyingly, sites will often use JavaScript to automatically make the page print. Here’s a simple way to stop it.

  1. Download and install GlimmerBlocker.
  2. Create a new Filter group (top left of preference pane).
  3. Add a new Rule.
  4. Set the Action to “Whitelist URL, optionally modifying content”.
  5. Set Host: to “all hosts”.
  6. Go to the transform tab.
  7. Paste in the following text: replace(/(window|self)\.print(\(\))?;/, "");
  8. Save the rule.

The regex here will look for window.print or self.print (with or without parentheses) and strip it, thereby stopping the automatic print command.

I forget exactly how I came up with this, but it works great.

UPDATE: an improved version is available.

written by Jordan Cole 13 August, 02009 Comments