0% found this document useful (0 votes)
42 views1 page

Compatibility: Javascript Document Object Model

Greasemonkey user scripts allow users to write or download scripts in JavaScript to modify and enhance web pages. These scripts can run when a user visits a supported website, making changes within the limitations of the Greasemonkey security model. Userscripts.org maintains a database of available Greasemonkey scripts that users can install for sites they visit. Writing Greasemonkey scripts is similar to writing JavaScript for web pages but provides some additional capabilities like cross-domain requests.

Uploaded by

Guffy Ganda
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views1 page

Compatibility: Javascript Document Object Model

Greasemonkey user scripts allow users to write or download scripts in JavaScript to modify and enhance web pages. These scripts can run when a user visits a supported website, making changes within the limitations of the Greasemonkey security model. Userscripts.org maintains a database of available Greasemonkey scripts that users can install for sites they visit. Writing Greasemonkey scripts is similar to writing JavaScript for web pages but provides some additional capabilities like cross-domain requests.

Uploaded by

Guffy Ganda
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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. [Link] 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 [Link], 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 fullfledged 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

You might also like