Greasemonkey
| Original author(s) | Aaron Boodman |
|---|---|
| Developer(s) | Anthony Lieuallen, Johan Sundström,[1] 13 more[2] |
| Initial release | 28 March 2005[3] |
| Stable release | 1.8[4] / 21 February 2013 |
| Written in | JavaScript, XUL, CSS |
| Operating system | Cross-platform |
| Available in | English |
| Type | Mozilla extension |
| License | Expat license |
| Website | www.greasespot.net |
| Contents |
|---|
| Origins and lineage |
| Category |
Greasemonkey is a Mozilla Firefox extension that allows users to install scripts that make on-the-fly changes to web page content after or before the page is loaded in the browser (also known as augmented browsing).
The changes made to the web pages are executed every time the page is viewed, making them effectively permanent for the user running the script.
Greasemonkey can be used for customizing page appearance, adding new functions to web pages (for example, embedding price comparisons within shopping sites), fixing rendering bugs, combining data from multiple web pages, and numerous other purposes.
Contents |
History [edit]
The Greasemonkey project began 28 November 2004.[5][6][7]
Technical details [edit]
Greasemonkey user scripts are written in JavaScript and manipulate the contents of a web page using the Document Object Model interface. Scripts are generally written to be either page-specific or domain-specific (applying to all pages within a domain) but may also be tagged to apply to all domains for global browser enhancements.
userscripts.org maintains a database of Greasemonkey scripts, and for each, lists the URLs of web pages to which the script pertains.[8] Users of Greasemonkey can write or download scripts and save them to their own personal library. When users visit a website matching a script in their personal script library, Greasemonkey invokes the relevant scripts.
Greasemonkey scripts can modify a webpage in any way that JavaScript allows, with certain Greasemonkey security restrictions. Scripts can also access other web pages and web services via a non-domain-restricted XMLHTTP request, allowing external content to be merged with the original page content.
Scripts are named somename.user.js, and Greasemonkey offers to install any such script when a URL ending in that suffix is requested. Greasemonkey scripts contain metadata which specifies the name of the script, a description, resources required by the script, 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 allowances such as cross-site XMLHttpRequests. Compared to writing a full-fledged Firefox extension, user scripting is a very modest step up in complexity from basic web programming. However, Greasemonkey scripts are limited due to security restrictions imposed by Mozilla's XPCNativeWrappers. For example, Greasemonkey scripts do not have access to many of Firefox's components, such as the download manager, I/O processes or its main toolbars. Additionally, Greasemonkey scripts run per instance of a matching webpage. Because of this, managing lists of items globally is difficult. However, script writers have been using cookies and Greasemonkey even offers APIs such as GM_getValue and GM_setValue to overcome this.
Compatibility [edit]
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 SeaMonkey[9] and Songbird.[10]
Equivalents for other browsers [edit]
Versions 8 and upwards of Opera also have user scripting functionality and are capable of running many Greasemonkey user scripts.[11]
For Internet Explorer, similar functionality is offered by IE7Pro,[12] Sleipnir,[13] iMacros, and Trixie.[14]
As of February 2010[update], Chrome has limited "native support" for Greasemonkey scripts.[15] They are internally converted to extensions, and are managed as such. Chrome honors the @include and @exclude directives, and introduces the @match objective as a simplified way to select specific domains/pages specified. In Chrome, scripts that use Firefox-specific functionality will break, and several Greasemonkey features are unavailable.[16] More compatibility is provided by the "TamperMonkey" extension, giving support for GreaseMonkey specific features.[17][18]
On Safari for Mac (and other WebKit applications), there is a SIMBL-managed plug-in called GreaseKit. Since the release of Safari 5 there is an extension called NinjaKit that uses the new API interface.[19] Fluid is a site-specific browser with integrated GreaseKit.
Kango [20] framework allows creating extensions for Firefox, Chrome, Internet Explorer, Opera, Safari using JavaScript only, the code being single for all browsers. Kango supports[21] user scripts.
See also [edit]
- List of augmented browsing software
- List of Firefox extensions
- ShiftSpace, an extensible platform for annotating and modifying web content, built on top of Greasemonkey
References [edit]
- ^ "The weblog about Greasemonkey".
- ^ "The greasemonkey network graph".
- ^ "Initial Greasemonkey Release".
- ^ Greasemonkey 1.8 Release on greasespot.net.
- ^ "Greasemonkey Project Info".
- ^ Pilgrim, Mark (2005). Greasemonkey Hacks. O'Reilly.
- ^ "Aaron Boodman wrote Greasemonkey in 2004".
- ^ http://userscripts.org/
- ^ "Greasemonkey". mozdev. Retrieved 2009-05-05.
- ^ ianloic. "Greasemonkey". Songbird. Retrieved 2009-05-05.
- ^ "Take Control with User JavaScript". Opera Software. Retrieved 2009-03-26.
- ^ "User Scripts in IE7Pro".
- ^ "You can also add custom functionality to Sleipnir with a wide range of plugins and user scripts".
- ^ "Trixie". Retrieved 2011-08-01.
- ^ Boodman, Aaron (2010-02-01). "40,000 More Extensions!". blog.chromium.org. Retrieved 2010-02-01.
- ^ "User Scripts - The Chromium Projects". Retrieved 2010-10-24.
- ^ https://chrome.google.com/webstore/detail/dhdgffkkebhmkfjojejmpbldmpobfkfo
- ^ Paul, Ian (18 January 2012). "How to Access Wikipedia on SOPA Protest Day". PC World. Retrieved 28 January 2013.
- ^ "New extension for Safari 5 called NinjaKit lets you install GM scripts". Excellatronic Communications. Retrieved 2010-07-22.
- ^ "Kango framework".
- ^ "Modifying content of web pages using Kango Framework and jQuery".
External links [edit]
- Greasemonkey at Mozilla Add-ons
- userscripts.org – The official user script repository
- Greasemonkey wiki
- Greasemonkey discussion page
- Greasemonkey code hosting – Powered by GitHub
- Greasemonkey blog
- Nivi. "Greasemonkey will blow up business models (as well as your mind)". Archived from the original on 2008-02-05. Retrieved 2010-07-22.
- Greasemonkey explained for non-techies
- Greasemonkey in the Enterprise – Blog series on security and deployment issues when using Greasemonkey for IT projects
- 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.
- Monkey see, GreaseMonkey do! - Video tutorial for GreaseMonkey user script development