This MedLibrary.org supplementary page on Greasemonkey is provided directly from the open source Wikipedia as a service to our readers. Please see the note below on authorship of this content, as well as the Wikipedia usage guidelines. To search for other content from our encyclopedia supplement, please use the form below:
Related Sponsors
| This article needs additional citations for verification. Please help improve this article by adding reliable references. Unsourced material may be challenged and removed. (August 2008) |
| Design by | Aaron Boodman |
|---|---|
| Latest release | 0.8.20080609.0 / 2008-06-12 |
| OS | Cross-platform |
| Available in | English |
| Type | Mozilla extension |
| License | Expat License |
| Website | www.greasespot.net/ |
| Mozilla Firefox (category) |
|---|
| Contents |
| Origins and Lineage |
|
|
Greasemonkey is a Mozilla Firefox extension that allows users to install scripts that make on-the-fly changes to most HTML-based web pages. As 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 functions 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.
Contents |
Technical details
Most Greasemonkey user scripts are written by hand, using site-specific JavaScript code that 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. 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 are named somename.user.js, and Greasemonkey automatically detects and offers to install any such script, when a URL ending in that suffix is loaded. 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 URL patterns for which the script is intended to be invoked or not.
Writing a Greasemonkey script is similar to writing JavaScript for a web page, with some additional restrictions imposed by the security provisions of Mozilla's XPCNativeWrappers. Compared to writing a full-fledged Firefox extension, user scripting is a very modest step up in complexity from basic web programming, but for the JavaScript illiterate and non-programmer incapable of writing a user script, the Platypus 1 extension allows them to edit a page (deleting or moving parts of it around as well as changing typeface and colors of elements on the page) to create persistent Greasemonkey scripts automating their changes.
Typical Greasemonkey scripts
Users have written scripts that:
- Auto fill forms.
- Alter the formatting of text, borders, graphics, etc. (For example, highlight first-run programs in a TV listing.)
- Remove specific content, such as advertising, popups, even whole sections of a page. (For example, filter specific posters from a message board site.)
- Alter content and layout beyond what the page author considered. (For example, add floating elements, make elements collapsible, etc.)
- Add links, buttons, or any other type of HTML element anywhere on the page. (For example, embed Google Reader into Gmail, thus providing an RSS feed option.)
- Enhance the content of pages by correlating information from related pages on the same site, or other sites. (For example, list the prices of competing retailers' for the same product.)
- Add extended JavaScript behavior to pages. (For example, collate RSS feeds on the current page into a floating panel. Allow the user save an FLV file from popular video streaming sites such as Google Video, YouTube, and Facebook.)
Technical, operational, and ethical issues arising from user scripting
| It has been suggested that it may be better to integrate the information in this article's Criticism or Controversy section(s) into the article as a whole to achieve a more neutral presentation. () (2008-03-22) |
| This article or section contains weasel words, vague phrasing that often accompanies biased or unverifiable information. Such statements should be clarified or removed. |
| The neutrality of this article is disputed. Please see the discussion on the talk page. (May 2008) Please do not remove this message until the dispute is resolved. |
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 some scripts. Such 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. An example is a script that retrieves data for every link on the page through XMLHttpRequests.
- 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.
- Script errors resulting from lack of coordination between Greasemonkey developers and the original Website developers.
- Greasemonkey only works on HTML-based pages, and does not work on Java, Flash, Flex, and Silverlight content within Web pages. An exception is where you attribute an embedded flash with the
swliveconnect=trueattribute, enabling you to modify variables in the Flash file.2 - Rich Internet Applications are more difficult for a Greasemonkey script developer to control than static Web pages. This is because the more logic that a page performs, the more complexities there are to consider for the Greasemonkey script writer to develop a script that will not interfere with the original application's function, and because of the high likelihood of further content being loaded (via XMLHttpRequest) after the main page load has completed.
- The original site developers can release a new version of the site that causes the Greasemonkey script designed for that site to stop working. Therefore, a Greasemonkey script written for a specific site without developer coordination cannot be considered a long-term solution.
- There is no official way for user scripts to update themselves; some developers added such functionality to their userscripts but most of them remain static, and eventually break.
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 are also custom versions for SeaMonkey3 and Songbird.4
Opera
Version 8 and upwards of Opera also have user scripting functionality. Both Opera and Firefox support the W3C DOM. Opera is capable of running many Greasemonkey user scripts.5
Safari
GreaseKit (formerly Creammonkey) and PithHelmet (shareware) are similar tools for the MacOS version of the Safari browser, along with other WebKit based applications such as MailPlane.
Konqueror
Konqueror Userscript is a webpage manipulation tool for KDE's Konqueror browser that aims for compatibility with Greasemonkey scripts and metadata. It is available as a KPart.
Internet Explorer
For Internet Explorer, similar function is offered by IE7pro, iMacros, Trixie (last updated 2005), Turnabout (last updated 2006) and Greasemonkey for IE (last updated 2006). Turnabout used to be open source software (under the BSD License), but as of September 2006, the source code is no longer available.
Google Chrome
Currently (as of 2008 Nov) there is only limited support for Greasemonkey scripts in Chrome beta (since build 3499).6 It's disabled by default, but can be enabled by adding --enable-greasemonkey as a startup parameter. As there is currently no method to load scripts within Chrome, scripts must be placed into the C:\scripts directory. Also @include metadata within the scripts is ignored and they are executed for all domains/pages.
Similar software
Browser level only (Firefox)
- AlchemyPoint combines a Firefox extension with a client side Proxy Server to allow for manipulation of web content, scraping of data from websites, detection/parsing of microformats, etc.
- 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 that allows arbitrary real time changes to a page's DOM
- Super GreaseMonkey is a mod of GreaseMonkey that supports runtime libraries (specifically jquery) for user scripts.
- Bubbles is the first Site-Specific-Browser, and it uses JS injection of user-scripts, very much like GreaseMonkey.
Proxy level
- Monkeygrease is a Java Servlet that alters the output of a closed-source Java web application before its output is sent to the client.
- Proxomitron, available since late 1990s, predates JavaScript active browsing and provides a similar function for all browsers using a regexp-like matching language.
- Proximodo, inspired by- and interoperable with proxomitron, is an open source, client side proxy server that allows page content manipulation.
- Privoxy is an open source, client side proxy server that allows manipulation of page content available in many OS flavors.
- MouseHole is a client side proxy server that allows manipulation of page content using Ruby.
- Muffin is a Java open-source stand alone proxy server that allows manipulation of page content (usually client-side, but sports a web interface in addition to a Swing GUI for configuration).
Alternatives
Without an extension like Greasemonkey, developers still can modify websites other ways:
- Enter javascript: URLs in the Location Bar or using bookmarklets
- Use the browser's DOM Inspector
- Use a full-fledged extension that serves the same purpose. (It is possible to convert much of the code in a GreaseMonkey script to become part of a Firefox extension. This is how GreaseMonkey scripters often "graduate" to extension writers.)
- Use a local HTTP proxy that modifies the HTML, such as WebWasher or Proxomitron
- Use the Opera browser and user.js scripts
See also
Notes
External links
| This article includes a list of references or external links, but its sources remain unclear because it lacks inline citations. Please improve this article by introducing more precise citations where appropriate. (August 2008) |
- Official Greasemonkey Mozilla Add-on page
- GreaseFire - a Firefox add-on, licensed under the GPL, that automatically notifies the user (via a statusbar icon) if a page they are visiting has Greasemonkey scripts available for use with it
- Greasemonkey Wiki
- Dive Into Greasemonkey - A free online book on Greasemonkey script writing by Mark Pilgrim
- UserScripts.org (formerly Greasemonkeyed.com) - User script repository
- UserStyles.org - User styles (CSS) for Stylish extension (many of which are also available in Greasemonkey format)
- UserJS.org - User JavaScript for Opera (many of which are also available in Greasemonkey format)
- Greasemonkey etiquette
- Nivi. "Greasemonkey will blow up business models (as well as your mind)". Archived from the original on 2008-02-05. Retrieved on 2008-09-29.
- Greasemonkey script compiler Converts Greasemonkey scripts into extensions
- Script compiler for conversion of Greasemonkey scripts to extensions
- Greasemonkey compiler converts Greasemonkey user scripts into full-fledged extensions
- Greasemonkey Explained for non-techies
- 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
- Festa, Paul (24 March 2005). "Firefox add-on lets surfers tweak sites, but is it safe?", CNET.
- Singel, Ryan (17 May 2005). "Firefox Users Monkey With the Web?", Wired magazine.
Wikipedia content modification information:
- This page was last modified on 4 January 2009, at 02:51.
Wikipedia Authorship and Review
Wikipedia content provided here is not reviewed directly by MedLibrary.org. Wikipedia content is authored by an open community of volunteers and is not produced by or in any way affiliated with MedLibrary.org.
Wikipedia Usage Guidelines
This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article on "Greasemonkey".
The URL for this specific entry is:
All Wikipedia text is available under the terms of the GNU Free Documentation License. (See Copyrights for details). Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc.
