greasemonkey
{{short description|Userscript manager extension for Firefox}}
{{about|the software|the comic|Grease Monkey|other uses|Grease monkey (disambiguation)}}
{{Use dmy dates|date=November 2015}}
{{Infobox software
| name = Greasemonkey
| logo = Greasemonkey.svg
| screenshot =
| caption =
| collapsible =
| author = Aaron Boodman
| developer = Anthony Lieuallen, Johan Sundström,{{Cite web|url=https://www.greasespot.net/2009/08/outie.html|title=Greasespot: Outie|last=boots|date=23 August 2009|website=Greasespot}} 13 more{{cite web|url=https://github.com/greasemonkey/greasemonkey/network|title=The greasemonkey network graph|website=GitHub}}
| released = {{release date and age|2005|03|28|df=yes}}{{Cite web|url=https://wiki.greasespot.net/Version_history|title=Version history – GreaseSpot Wiki|website=wiki.greasespot.net}}
| latest release version = 4.13
| latest release date = {{release date and age|2024|08|05|df=yes}}
| latest preview version =
| latest preview date =
| programming language = JavaScript, XUL, CSS
| operating system = Cross-platform
| language = English
| genre = Mozilla extension
| license = MIT License
| website = {{URL|https://www.greasespot.net/}}
}}
{{Firefox TOC}}
Greasemonkey is a userscript manager made available as a Mozilla Firefox extension. It enables 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.
History
The Greasemonkey project began 28 November 2004, written by Aaron Boodman.{{cite web|url=https://www.mozdev.org/projects/overview/greasemonkey/|title=Greasemonkey Project Info|access-date=31 August 2011|archive-url=https://web.archive.org/web/20120325005436/https://www.mozdev.org/projects/overview/greasemonkey/|archive-date=25 March 2012|url-status=dead}}{{cite book | last = Pilgrim | first = Mark | title = Greasemonkey Hacks | publisher = O'Reilly | year = 2005 | url = https://books.google.com/books?id=KWRE2C_S4YsC&q=youngpup.net+2004+greasemonkey&pg=PR14| isbn = 978-0-596-55357-9 }}{{Cite web |last=Boodman |first=Aaron |date=1 February 2010 |title=40,000 More Extensions! |url=https://blog.chromium.org/2010/02/40000-more-extensions.html |access-date=5 March 2023 |website=Chromium Blog}} Boodman was inspired to write Greasemonkey after looking at a Firefox extension designed to clean up the interface of AllMusic, written by Adrian Holovaty, who later became a userscript developer. By May 2005, there were approximately 60 general and 115 site-specific userscripts distributed for Greasemonkey.{{cite news | last=Singel | first=Ryan | title=Firefox Users Monkey With the Web? | date=17 May 2005 | publisher=Wired magazine | url=http://archive.wired.com/science/discoveries/news/2005/05/67527}} In July 2005, serious vulnerabilities were found in Greasemonkey by Mark Pilgrim,{{Cite web |url=http://mozdev.org/pipermail/greasemonkey/2005-July/004033.html |title=[Greasemonkey] greasemonkey for secure data over insecure networks / Sites |access-date=24 February 2021 |archive-date=3 March 2020 |archive-url=https://web.archive.org/web/20200303221552/http://mozdev.org/pipermail/greasemonkey/2005-July/004033.html |url-status=dead }}{{Cite web|url=https://lwn.net/Articles/144452/|title = Security [LWN.net]}} and fixed in the 3.5 version of Greasemonkey.{{cite web |url=http://mozdev.org/pipermail/greasemonkey/2005-July/004379.html |title=mozdev.org – : /pipermail/greasemonkey/2005-July/004379 |website=mozdev.org |url-status=dead |archive-url=https://web.archive.org/web/20050729013418/http://mozdev.org/pipermail/greasemonkey/2005-July/004379.html |archive-date=2005-07-29}} During this time, a Greasemonkey compiler was also developed for converting a userscript into a standalone Firefox extension.{{cite web |url=http://www.nivi.com/blog/article/greasemonkey-and-business-models |archive-url=https://wayback.archive-it.org/all/20060603031119/http://www.nivi.com/blog/article/greasemonkey-and-business-models/ |title=Greasemonkey will blow up business models (as well as your mind) |date=8 May 2005 |author=Nivi |archive-date=3 June 2006 |access-date=22 July 2010 |url-status=dead }} Greasemonkey was initially met with complaints by publishers for its ability to block ads.{{cite news | last=Festa | first=Paul | title=Firefox add-on lets surfers tweak sites, but is it safe? | date=24 March 2005 | publisher=CNET | url=http://news.cnet.com/Firefox-add-on-lets-surfers-tweak-sites,-but-is-it-safe/2100-1032_3-5631009.html}} However, this criticism shifted its focus to other addons starting with the 2006 release of Adblock Plus.
= Userscripts.org =
To accommodate the growing number of scripts, userscripts.org was founded by Britt Selvitelle and other members of the Greasemonkey community in late 2005. Userscripts.org was open sourced in 2007 but the site later moved away from this code base.{{cite web|url=http://lukewarmtapioca.com/2007/1/3/userscripts-org-opensource|title=Userscripts.org... Opensource!|first=Britt|last=Selvitelle|date=3 January 2007|access-date=21 May 2014|archive-date=17 January 2007|archive-url=https://web.archive.org/web/20070117065443/http://lukewarmtapioca.com/2007/1/3/userscripts-org-opensource}} As the main script repository listed on Greasemonkey's official site, userscripts.org accumulated thousands of scripts per year.
In 2010, the last known admin Jesse Andrews posted that the site was in maintenance mode due to lack of time and asked for a new maintainer to volunteer.{{cite web|url=https://news.ycombinator.com/item?id=1574840|title=Passing the torch on userscripts.org|work=Hacker News|year=2010|access-date=24 October 2014}} Nevertheless, he remained the sole admin of the site until a discussion about install counts began on 1 April 2013.{{cite web|url=http://userscripts.org/topics/124726|title=Fixing Install Counts|date=1 April 2013|access-date=21 May 2014|archive-url=https://web.archive.org/web/20131103143628/http://userscripts.org/topics/124726|archive-date=3 November 2013}} Prior to this, many of the "most popular scripts" as listed by the site had nominal install counts of zero. Over the following year spam scripts became more common, server downtime increased and the install count bug remained.{{cite web|url=http://www.ghacks.net/2014/05/09/userscripts-org-good-alternatives/|title=Userscripts.org down for good? Here are alternatives|first=Martin|last=Brinkmann|date=9 May 2014|access-date=21 May 2014}} With no further communication by Andrews, userscript writers described the site as neglected and the official Greasemonkey site removed its front page link.{{cite web|url=http://wiki.greasespot.net/User_Script_Hosting|title=User Script Hosting|date=16 May 2014|access-date=21 May 2014}}{{cite mailing list|url=https://groups.google.com/forum/#!topic/greasemonkey-dev/FDTswcuQW6Y|title=Please change the official userscript site|date=21 April 2014|access-date=21 May 2014|mailing-list=greasemonkey-dev}} In response, script writers and other developers began working on the fork "openuserjs.org",{{cite web|url=https://openuserjs.org|title=OpenUserJS|work=openuserjs.org}}{{cite web|url=http://userscripts.org/topics/124726?page=6|title=Fixing Install Counts – Page 6|date=1 April 2013|access-date=5 November 2015|archive-url=https://web.archive.org/web/20131103143628/http://userscripts.org/topics/124726?page=6|archive-date=3 November 2013}} and later greasyfork.org,{{cite web|url=https://greasyfork.org|title=Greasy Fork|work=greasyfork.org}} as an immediate replacement.{{cite web|url=https://forum.userstyles.org/discussion/comment/85771/#Comment_85771|title=Introducing Greasy Fork – a user scripts site|first=Jason|last=Barnabe|date=19 February 2014|access-date=5 November 2015}}
In May 2014, userscripts.org became inaccessible on port 80, prompting users to access it on port 8080 instead. In August 2014, the site was shut down completely. Most of its scripts were backed up to the static mirror userscripts-mirror.org where they can now be found.
Technical details
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. 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{{Cite web |url=https://developer.mozilla.org/en/XPCNativeWrapper |title=XPCNativeWrapper – MDC Docs |access-date=16 March 2011 |archive-date=28 June 2011 |archive-url=https://web.archive.org/web/20110628193117/https://developer.mozilla.org/en/XPCNativeWrapper |url-status=dead }} 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.
= User scripts =
File hosting servers for Greasemonkey require that the URLs for the scripts end with .user.js
and not with a MIME type like text/html
. Support for HTTPS will meet with{{clarify|date=April 2018}} Greasemonkey's built in update checker. As of July 2019, the Greasemonkey project lists three recommended user script hostings:{{Cite web|url=https://wiki.greasespot.net/User_Script_Hosting|title=User Script Hosting – GreaseSpot Wiki|website=wiki.greasespot.net|access-date=2019-07-22}}
- Gist, a pastebin service operated by GitHub where simple files are hosted. Files can be pasted into a web form and saved. HTTPS is used by default. Files may follow the naming scheme with the ".user.js" suffix for the URL serving as an install link.
- Greasy Fork, a site created by the maintainer of userstyles.org.
- OpenUserJS.org, a site that started as a fork for the deprecated script repository userscripts.org.
Compatibility
Greasemonkey is available for Firefox, Flock, and GNOME Web (formerly called Epiphany). The Greasemonkey extension for Web is part of the Web 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,{{cite web|url=http://xsidebar.mozdev.org/modifiedmisc.html#greasemonkey|title=Greasemonkey|publisher=mozdev|access-date=2009-05-05|work=mozdev.org|archive-date=23 April 2015|archive-url=https://web.archive.org/web/20150423025939/http://xsidebar.mozdev.org/modifiedmisc.html#greasemonkey|url-status=dead}}{{cite web|url=https://openuserjs.org/about/Greasemonkey-Port-for-SeaMonkey|title=Greasemonkey Port for SeaMonkey – About – OpenUserJS|website=openuserjs.org}} Songbird,{{cite web|url=http://addons.songbirdnest.com/addon/79|title=Greasemonkey|last=ianloic|publisher=Songbird|access-date=5 May 2009|url-status=dead|archive-url=https://web.archive.org/web/20080602060326/http://addons.songbirdnest.com/addon/79|archive-date=2 June 2008|df=dmy-all}} Pale Moon,{{Cite web|url=https://github.com/janekptacijarabaci/greasemonkey|title=janekptacijarabaci/greasemonkey|website=GitHub|language=en|access-date=2020-03-23}} qutebrowser,{{Cite web|title=Improvements for GreaseMonkey support · Issue #3238 · qutebrowser/qutebrowser|url=https://github.com/qutebrowser/qutebrowser/issues/3238|website=GitHub|language=en|access-date=2020-05-19}} and Falkon browser.
See also
References
{{Reflist|30em}}
External links
{{commons category-inline}}
- {{Official website|https://www.greasespot.net/}}
Category:Free Firefox WebExtensions