Friday, March 25, 2005

Grease Monkey extension to Firefox

There is a new extension to Firefox to enable you to make changes in the pages you download, but there are caveats to consider.

GreaseMonkey lets you to add bits of DHTML ("user scripts") to any webpage to change it's behavior. In much the same way that user CSS lets you take control of a webpage's style, user scripts let you easily control any aspect of a webpage's design or interaction.

A pretty comprehensive collection of known scripts is maintained at the Greasemonkey Script Repository. For example:

  • Change Amazon links to use an affiliate ID (if you click on a link to a book sold by Amazon, rather than giving credit for the sale to the webmaster of the page you are viewing, credit yourself for the sale. I don't know whether Amazon will allow such you to do that, but at least this script would let you try)
  • Change links to NYT articles to point to the print format (which don't have ads)
  • Slashdot: Remove Ads
  • Hides ads and iframes at Weather.com
  • Numbers the results in a Google search page and you can press 1..10 to follow the link with a single key stroke.
  • Hides Google Adsense IFrames.
  • Hides all Iframes, no matter where and what they contain. (Great way to get rid of 90% of all the "rich media" ads around.)
  • Inserts an inline play button(flash plugin required) after every link on page that ends with a .mp3 extension
  • Turn all URLs on a page into hyperlinks.
  • Recolors page background, foreground, and links to user-definable colors (defaults to white background, black text, blue links, purple visited links)
  • Adds a skin link down the bottom of every page which lets you add custom css to the page (uses cookies to auto load css).
For more information, there is a greasemonkey blog

CNet reported Firefox add-on lets surfers tweak sites, but is it safe? A popular new extension for Firefox that lets people customize Web pages they visit without the knowledge or cooperation of Web publishers. The extension, dubbed Greasemonkey, lets people run what's known as a "user script," which alters a Web page as the page is downloaded.

That capability has gained the extension an avid following of Web surfers who want to customize the sites they visit, removing design glitches and stripping sites of ads. But the extension comes with substantial security risks and could stir trouble among site owners who object to individual, custom redesigns of their pages.....

Bottom line: The catch is that the type of scripts used to enable the customization can also be used by cyberthugs to make mischief on people's PCs. Caution, then, is advised.


Will’s Blog says Is Greasemonkey Safe?

Although Paul Festa disagrees with me, I’m betting yes, as long as users are careful about what they install. I didn’t get started with Greasemonkey until tonight, but I can already determine just how useful but potent it is. You can modify pages, for better or for worse. Of course, the more rights you afford the user, the more responsibilities they inherently assume (and, if you’re dealing with novices, the more room there is for errors due to misconfiguration or misuse). The onus is on the user to ensure that the scripts they download and install are legal and safe to the user’s computer.

One should be careful with installing Greasemonkey scripts as one is with installing extensions or themes. Because that’s basically what those little JavaScripts are: extensions that don’t require a Firefox reboot and have a separate configuration panel. Treat them as such, and you’ll be handling them with the caution they require.


Hat Tip to TechLawAdvisor which says Greasemonkey can strip out ads, may have some security risks, and make the slashdot site "less ugly." Can anyone, who has used Greasemonkey, provide some comments regarding its capabilities? Tim Hadley commented I've experimented with some Greasemonkey user scripts that some website maintainers might find most pernicious of all -- they strip out ads. For example, one in particular targets Google AdSense ads, which are actually some of the least intrusive advertisements out there. Some scripts work better than others. For example, I tried one script that was supposed to remove or rearrange ads from Weather Underground pages and it did nothing. I don't think I'm going to do much more with it. I'll filter out advertisements using my "behavioral advertisement filter" -- avoiding sites that advertise heavily.

Update 3/25 adrian holovaty blogs Here's a Greasemonkey script I just cooked up: Google Suggest for Greasemonkey. It makes the dynamic drop-down from Google Suggest a bona fide part of Google, placing it on the Google home page and on search-result pages.

No comments: