How to rewrite your favorite Web sites.

Inside the Internet.
Sept. 26 2005 1:05 PM

How To Monkey With the Web

The software that lets you rewrite your favorite sites.

Illustration by Mark Alan Stamaty.
Click image to expand.

I can't go a day without checking Boing Boing, the quirky blog that throws vintage art, live posts from hurricane zones, and Japanese robots onto the same page. The problem is that I work in an open office where everyone can see my screen, and Boing Boing's home page is festooned with scantily clad T-shirt models and ads for soft-core porn sites. Wouldn't it be great if I could turn those ads off at the office?

Thanks to a piece of software called Greasemonkey, I can do that and lots more. Greasemonkey, a plug-in for the Firefox browser, allows you to run "user scripts"—Javascript programs that tweak other people's Web pages after you've loaded them. (In theory you could pull this same stunt with Internet Explorer, but no one's offered the software yet.) Most commercial sites already have Javascript programs nested inside that turn menus on and off or respond when you press a button. Google Maps is a great example—it's more program than page.

Advertisement

Greasemonkey lets you play Web designer. Instead of settling for a site's out-of-the-box appearance and functionality, you can stuff in your own Javascript apps. User scripts can rearrange or remove images, add links and buttons, even mix content from multiple Web sites onto the same page. Greasemonkey doesn't mess with the entire Internet. The software waits until a page is downloaded to your local machine, then modifies it on your screen only—when I hide Boing Boing's cheesecake, the girlie pics are still there for every other Web surfer.

Don't worry, you don't have to write the scripts yourself. Gung-ho Greasemonkey acolytes have already written a few thousand mini-applications that, for example, add competitors' prices to Amazon's book pages, install extra buttons on Google, and increase the security of Yahoo! Mail sessions. All of this is a shocking reminder that Web pages aren't static. Talk of the spread of "remix culture" has become standard fare—we TiVo past commercials, burn mix CDs, and make Bush and Blair lip-sync to "Endless Love." But site designers have somehow convinced us that their pages are as immutable as a glossy brochure. Greasemonkey resurrects the Web's original spec: Page layouts are just suggestions, people. Everything is remixable.

When I wrote about Greasemonkey for Wired recently, I argued that this simple program had the potential to mess with the business models of e-commerce sites. Many user scripts undo copyright protection, remove ads and sponsored links, or end-run registration pages. The experts I interviewed predicted a cops-and-robbers battle between site owners and script hackers. Greasemonkey might make the Net a better-designed place; it might just rob online vendors of their revenue.

(You might've heard that Greasemonkey will also make the net a less secure place. Reports that the software has a massive security hole are out of date, though. That bug, which was never exploited, got patched within days back in July. That's not a 100-percent security guarantee, but be aware that Firefox has yet to see the kind of real attacks that barraged Internet Explorer last year.)

Readers e-mailed to say all of this would be really interesting—if only they could get the damn thing to work on their computer. Indeed, Greasemonkey's makers stunted its superpowers with a standard geek blunder: There aren't any installation instructions.

That's easy to fix. It takes five minutes to get Greasemonkey up and running, and you won't have to close this page to do it. To see my step-by-step instructions, click here.

Once you have Greasemonkey installed, you're ready to take a tour of the Web as customized by its users. The best place to start is Userscripts.org, a repository of 1,800 mini-applications that address a laundry list of gripes. Install the BoingBoing Butler, and—voilà!—Boing Boing's ad-laden sidebars appear briefly, then wink out of existence. The middle strip of stories widens to fill the empty space.

Userscripts.org also includes applications that let you fix CNN's buggy video links and eBay's feedback pages, which (until now) didn't let you hide all the positive posts and show just the complaints. You can add Internet Movie Database ratings to Netflix movie pages, or Blockbuster links to IMDb. Ad-remover scripts are popular, but the cooler ones clean up awkward sites or add obvious features that the designer left out. There are dozens of scripts just for Google. One Gmail widget puts a Delete button right where Sergey and Larry left it out. Another adds a history of your recent searches whenever you revisit the site.

After spending a weekend looking for the most striking example of Greasemonkey's power, I gave top honors to two scripts. (And an honorable mention to this goofy but eye-opening script that turns Boing Boing into an interactive quiz by replacing the author bylines with multiple-choice popup menus.)

Magic Line crawls every page you visit and creates a searchable history of links and RSS feeds you might have missed. Hold down Ctrl-Shift-L and a semitransparent search pane appears atop your browser window. I typed "New Orleans" and found a blog entry from the storm zone that I'd overlooked while speed-surfing.

The American Memory photo collection, before and after Greasemonkey. Click image to expand.
The American Memory photo collection, before and after Greasemonkey

The other winning script overhauls the Library of Congress'American Memory photo collection, a valuable archive hobbled by HTML pages straight out of 1995. Install the American Memory Fixer and the exhibit gets a makeover: tidy white pages with new fonts, a smarter layout, and large photos rather than thumbnails. It's more than a modification—it's a renovation.

These demos inspired me to write my own user script to streamline the site I've been working for into a lightweight search page. After an hour of fruitless keyboard-pounding, I realized the guys who wrote Magic Line and American Memory Fixer spend a lot more time on this than I do.

That's the limitation that threatens Greasemonkey's potential: Unless you're a natural programmer, you'll just have to hope some hacker shares your annoyance with, say, Slate's front page. So far the distribution of scripts is twofold—they're either for superpopular sites like CNN or programmer's hangouts like Slashdot, with a few niche favorites thrown in. (I haven't found a single script for Slate yet.) You also better hope the guy who programmed your script knows what he's doing. Buyer beware, because not all Greasemonkey scripts work flawlessly: My editor installed one that promised to trim the ads on IMDb, but it erased his whole page instead. (A script that doesn't work as advertised is annoying but won't cause any permanent damage—it's easy enough just to turn it off).

Greasemonkey recalls the giddy fun of when browsers first came out a dozen years ago. It also suffers from the same problem that hamstrung the Web before the arrival of easy-to-use site-building tools. Only a tech-savvy elite knows enough to play with it. The rest of us are still consumers. What we need is a Greasemonkey Remix Tool, a what-you-see-is-what-you-get editor that lets us redesign other people's Web pages on-screen, then spits out a script to make it happen. Something this powerful is too good to let the hackers have all to themselves.

Paul Boutin is a writer living in San Francisco.