:''For the slang term referring to a
mechanic see
Grease monkey. For the comic see
Grease Monkey.''

Screenshot of the ''BookBurro'' user script running in Greasemonkey. BookBurro alters an 'amazon.com' page to show the prices of the same book offered by competing retailers.
'Greasemonkey' is a
Mozilla Firefox extension that allows users to install
scripts that make
on-the-fly changes to specific
web pages. As the Greasemonkey scripts are persistent, the changes made to the web pages are executed every time the page is opened, making them effectively permanent for the user running the script.
Greasemonkey can be used for adding new functionality to web pages (for example, embedding price comparison in
Amazon.com web pages), fixing rendering bugs, combining data from multiple webpages, and numerous other purposes. Well written Greasemonkey scripts can integrate changes so well that their additions appear to be natural parts of the web page.
Technical details
Most Greasemonkey user scripts are written by hand, using site-specific
JavaScript code which manipulates the contents of a web page using the
Document Object Model interface.
userscripts.org maintains a database of Greasemonkey scripts, and for each it lists the
URLs of web pages to which the scripts pertain. (N.B. The
obsolescent script repository ''might'' contain some older scripts that have not yet migrated to the
new repository.) When the user loads a matching page Greasemonkey invokes the relevant scripts, which can then add to the page, delete parts of it, or move parts around. Greasemonkey scripts can also poll external HTTP resources via a non-domain-restricted
XMLHTTP request. Greasemonkey scripts have the format ''somename''.user.js, and Greasemonkey automatically detects and offers to install any such scripts which it encounters. In addition to JavaScript code, Greasemonkey scripts contain limited optional metadata, which specifies the name of the script, a description, a namespace URL used to differentiate identically named scripts, and the default list of URLs for which the script is intended.
Writing a Greasemonkey script is a technically demanding process (although rather easier than writing a full-fledged Firefox extension). This means that few ordinary users can practically write Greasemonkey extensions. The
Platypus [1] extension, however, allows users to edit a page (deleting parts of it, or moving parts around); Platypus then saves these changes as a persistent Greasemonkey script.
Typical Greasemonkey scripts
Users have written scripts which:
★ Alter
Gmail to embed
Google Reader into it, thus providing an
RSS feed option.
★ Show a list of competing retailers' prices for a book when viewing the book on online retailers.
★ Remove advertisements from many sites, including popups and
Google text ads.
★ Alter the layout of pages, including sizes of elements and screen sizes other than what the author considered.
★ Autofill forms.
★ Filter specific posters from message board sites.
★ Add or remove accessibility features from pages.
★ Let a user save an
FLV file from popular video streaming sites such as
Google Video and
YouTube.
★ Discover any RSS feeds in the current page, displaying them in an expandable floating panel.
Technical, operational, and ethical issues arising from user scripting
Some in the Firefox community, and a number of technical analysts, warn that widespread use of Greasemonkey and related user scripting technologies will require care in deployment. Their concerns include:
★ Possible disruption to revenue of some websites. Some Firefox users already block web advertisements with
Adblock Plus, but Greasemonkey may be used to change ads from one company to those of their competitor, to artificially inflate web advertising scores, or to fool the statistics programs run by paid browsing companies.
★ Increases in the web traffic that arise from every page. Some Greasemonkey scripts obtain additional information about pages the user visits, for example from services such as
del.icio.us and
Bloglines. If these scripts were widely used, they would cause substantial additional traffic to the target websites.
★ The proliferation of scripts acting on many pages, and the difficulty of distinguishing whether problems in a page are caused by actual web-programming bugs or by local Greasemonkey scripts, may make troubleshooting defects more difficult.
Greasemonkey compatibility and equivalents for other browsers
Other Mozilla-based browsers
Greasemonkey is available for Firefox,
Flock and
Epiphany. The Epiphany Greasemonkey extension is part of the
Epiphany-extensions package. However, this extension is not fully compatible as of release 2.15.1, since some Greasemonkey
API functions (e.g. ''GM_getValue'') are unsupported. There is also a custom version for
SeaMonkey:
[2]
Opera
Version 8 of
Opera also adds
user scripting functionality. As both Opera and Firefox support the W3C DOM, many Greasemonkey user scripts also work correctly on Opera.
Safari
Creammonkey and
PithHelmet (shareware) are similar tools for the
Safari browser
Konqueror
Konqueror Userscript is a webpage manipulation tool for
KDE's
Konqueror browser which aims for compatibility with Greasemonkey scripts and metadata. It is available as a
KPart.
Internet Explorer
For
Internet Explorer,
IE7pro,
iMacros,
Trixie (last updated 2005), and
Turnabout (last updated 2006) offer similar functionality. Turnabout used to be
open source software (under the
BSD License), but as of September 2006, the source code is no longer available. Greasemonkey for Firefox is under continual development so older Greasemonkey for Internet Explorer plugins are missing required features for modern scripts.
Similar software
★
Proxomitron, available since late 1990s, predates JavaScript active browsing and provides similar functionality for all browsers using a
regexp-like matching language.
★
Proximodo, inspired by- and interoperable with proxomitron, is an open source, client side
Proxy Server which allows manipulation of page content
★
Privoxy is an open source, client side
Proxy Server which allows manipulation of page content available in many OS flavors
★
MouseHole is a client side
Proxy Server which allows manipulation of page content using
Ruby.
★
Monkeygrease is a
Java Servlet which can be used to alter the output of a closed-source Java web application before its output is sent to the client.
★
Chickenfoot is a Firefox extension that aims to enable both end-user programmers and hackers to script interactions on the Web.
★
iMacros for Firefox is a Firefox extension that allows the user to record and replay so called "Internet Macros" for web automation, web scraping or web testing.
★
Stylish is a Firefox extension that allows for client-side manipulation of webpage content through
Cascading Style Sheets.
★
Bookmarklets can execute arbitrary JavaScript on any page, but they require a user to click them, rather than running automatically.
★
Firebug is a developers extension which allows arbitrary realtime changes to a pages DOM
Alternatives
Without an
extension like Greasemonkey, modifications to websites can also be done in one of the following ways:
★ Entering
javascript: URLs in the Location Bar or using
bookmarklets
★ Using the browser's
DOM Inspector
★ Using a local HTTP proxy that modifies the HTML, such as
WebWasher or
Proxomitron
★ Using the Opera browser and user .js scripts
See also
★
Adblock
★
List of Firefox extensions
External links
★
Homepage of the Greasemonkey extension
★
Greasemonkey Wiki
★
''Dive Into Greasemonkey'', a free book on Greasemonkey script writing by Mark Pilgrim
★ The
old Greasemonkey script repository contains a number of scripts created by people for their personal needs, and uploaded for use by others.
★
userscripts.org (formerly
Greasemonkeyed.com) - the script repository that replaces dunck.us
★
UserJS.org - User Javascripts for Opera (many of which are also available in Greasemonkey format)
★
Greasemonkey etiquette
★
Greasemonkey and its effect on business models
★
Script compiler for conversion of Greasemonkey scripts to
Mozilla extensions
★
Greasemonkey compiler converts Greasemonkey user scripts into full-fledged
Mozilla extensions
★
Greasemonkey Explained for non-techies
★
browserscripts.org Scripts community
★
Greasemonkey in the Enterprise - blog series on security and deployment issues when using Greasemonkey for IT projects
★
InternetDuctTape.com - Beginner's Guide to installing and using Greasemonkey user scripts
External reviews
★
Firefox add-on lets surfers tweak sites, but is it safe? Paul Festa
★
Firefox Users Monkey With the Web? Ryan Singel