Generated by GPT-5-mini| GreaseMonkey | |
|---|---|
| Name | GreaseMonkey |
| Developer | Aaron Boodman |
| Released | 2004 |
| Programming language | JavaScript, XUL, XML |
| Operating system | Cross-platform |
| License | MPL/GPL/LGPL tri-license |
GreaseMonkey is a Mozilla Firefox extension that enables end users to customize the appearance and behavior of web pages by running user-supplied JavaScript. It integrates with the Mozilla Firefox extension system and the Mozilla Foundation ecosystem to inject scripts into pages matching user-defined patterns, allowing modifications of content delivered from sites such as Wikipedia, YouTube, Amazon (company), Twitter, and Facebook. GreaseMonkey has influenced extension models across browsers and inspired communities around userscript development, spawning compatible projects and standards.
GreaseMonkey provides a lightweight framework to attach JavaScript snippets—commonly called userscripts—to web pages when they load. It exposes a minimal Application Programming Interface for tasks like persistent storage, cross-domain requests, and metadata blocks, enabling users to customize pages served by sites including BBC, Google, Reddit, Stack Overflow, Gmail, LinkedIn, and Netflix. The extension operates within the Firefox Add-ons architecture and has parallels with other projects such as Tampermonkey and Violentmonkey, which extend support to Google Chrome, Microsoft Edge, Opera, and Safari.
GreaseMonkey was created by Aaron Boodman and first released in 2004 as part of the early expansion of the Mozilla extensions ecosystem alongside projects like Extensions for Firefox and XULRunner. Its development trajectory intersected with milestones such as the release of Firefox 3, the evolution of the Mozilla Add-ons site, and the transition to the WebExtensions API introduced with Firefox 57 ("Quantum"). Over time, compatibility efforts and forks responded to platform changes and legal considerations exemplified by debates surrounding the MPL tri-license and community governance practices used by projects like LibreOffice and Apache Software Foundation initiatives. Significant contributors and maintainers in the broader userscript ecosystem include authors active on sites like Greasy Fork and OpenUserJS.
GreaseMonkey implements core features to alter page behavior at load time. It supports metadata blocks that describe script matches using patterns akin to the robots.txt matching style and allows access to APIs for storage, logging, and asynchronous XMLHttpRequest or Fetch API-style operations. Common functionality includes DOM manipulation on sites such as CNN, The New York Times, The Guardian, Stack Exchange, and Hacker News; automated form filling for services like PayPal and eBay; and UI augmentation for tools such as Google Calendar and Trello. The extension hooks into Firefox lifecycle events, employing techniques comparable to Content Scripts in Chrome extension development and borrowing concepts from UserScript Manager patterns.
Userscripts are distributed as JavaScript files annotated with metadata headers that specify grants, include/exclude directives, and required resources. The API includes functions for persistent storage (similar to the Web Storage API used by Mozilla Developer Network examples), cross-origin resource access guarded by permissions, and utilities for adding CSS or running code at document-start or document-end. Script distribution and discovery occurred through repositories and wikis operated by communities around SourceForge, GitHub, GitLab, Bitbucket, and dedicated sites like Userscripts.org (now defunct), Greasy Fork, and OpenUserJS. Famous userscripts have targeted pages on YouTube, Wikipedia, IMDb, Amazon (company), and Facebook, altering interface elements or adding metadata from sources such as IMDb and Rotten Tomatoes.
Running arbitrary JavaScript from third-party sources raises risks managed by GreaseMonkey through permission models and user prompts. Malicious or poorly written scripts can exfiltrate credentials on sites like Gmail or Facebook, perform cross-site request forgery against services such as PayPal or Stripe, or modify content on news sites like CNN and BBC to mislead users. Auditing practices mirrored those in organizations like OWASP and EFF encourage code review, sandboxing patterns, and principle-of-least-privilege grants. The community response often echoes approaches used by Mozilla Foundation security advisories and incident response procedures from projects like Apache Software Foundation.
GreaseMonkey's model inspired and interoperates with alternatives including Tampermonkey, Violentmonkey, and native WebExtensions content scripts. As browsers converged on the WebExtensions API, ports and rewrites ensured compatibility with Chrome, Edge, Opera, and Safari via projects maintained on GitHub and mirrored on GitLab. Differences in permission semantics, performance, and UI integration distinguish these implementations; for example, Tampermonkey emphasizes cross-browser syncing while Violentmonkey focuses on standards compliance and minimal UI. For site-specific automation, users sometimes choose automation platforms like Selenium (software) or Puppeteer.
A vibrant community formed around script authors, repository maintainers, and forum participants on platforms such as Stack Overflow, Reddit, Mozilla Discourse, and issue trackers hosted on GitHub. Collaborative projects and events include tutorial series on Mozilla Developer Network, userscript showcases on Greasy Fork, and coordination through channels affiliated with Freenode-era communities and modern alternatives like Matrix (protocol). The ecosystem intersects with open-source governance models used by GNU Project, Debian, and other volunteer-driven projects, relying on volunteer moderation, code review, and repository curation to maintain quality and security.
Category:Mozilla Firefox extensions