Getting Started ⬌ Installing Scripts ⬌ Managing Scripts ⬌ Monkey Menu ⬌ Creating Scripts ⬌ Environment ⬌ Other Useful Tools ⬌ API
This section of the manual will be short and sweet. As mentioned elsewhere, Greasemonkey provides several methods in its API to enhance the power of the User script. They are listed here, with a brief description, but each separate method has its own page with more in-depth information, please continue reading there.
⬆ ⬇ | Values | Resources | Common Task Helpers | Other| Special
Metadata Block : Uses JavaScript comments to identify a user scripts information and capabilities.
GM_deleteValue : Deletes a single name to value from persistent storage.
GM_getValue : Retrieves a single name to value from persistent storage.
GM_listValues : Retrieves an array of names to values that start with the root from persistent storage.
GM_setClipboard : Copies temporary storage data to the local clipboard.
GM_setValue : Sets a single name to value in persistent storage.
GM_getResourceText : Loads raw, plaintext from a resource.
GM_getResourceURL : Loads an external resource via a URL, such as an image, and returns the string containing the base64 encoded in the data: URL scheme.
GM_addStyle : Appends a CSS style
element to the head
element of window
.
GM_xmlhttpRequest : Provides a cross-origin xmlHttpRequest.
unsafeWindow : Provides access to the Content Scope (a.k.a the restricted namespace) window
object.
GM_log : Outputs a chrome message to the Error Console. This is useful for examining values when writing a script.
GM_openInTab : Opens a new Url in a new tab
GM_registerMenuCommand : Inserts a menu item into the Monkey Menu
GM_info : Exposes some information to the user script via an Object
Getting Started ⬌ Installing Scripts ⬌ Managing Scripts ⬌ Monkey Menu ⬌ Creating Scripts ⬌ Environment ⬌ Other Useful Tools ⬌ API
All GM_* functions were blocked in version 0.3.5, due to security vulnerabilities. These functions were restored with updates making them secure, and the new unsafeWindow object was added, in version 0.5 beta
Wiki: GM_addStyle
Wiki: GM_deleteValue
Wiki: GM_getResourceText
Wiki: GM_getResourceURL
Wiki: GM_getValue
Wiki: GM_info
Wiki: GM_listValues
Wiki: GM_log
Wiki: GM_openInTab
Wiki: GM_registerMenuCommand
Wiki: GM_setClipboard
Wiki: GM_setValue
Wiki: GM_xmlhttpRequest
Wiki: Greasemonkey_Manual:Creating_Scripts
Wiki: Greasemonkey_Manual:Environment
Wiki: Greasemonkey_Manual:Getting_Started
Wiki: Greasemonkey_Manual:Installing_Scripts
Wiki: Greasemonkey_Manual:Managing_Scripts
Wiki: Greasemonkey_Manual:Monkey_Menu
Wiki: Greasemonkey_Manual:Other_Useful_Tools
Wiki: Metadata_Block
Wiki: Script_injection_rules
Wiki: User_script
Wiki: unsafeWindow