Editing
Greasemonkey Manual:API
From Greasespot Wiki
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
__NOTOC__ {{Greasemonkey Manual TOC}} 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 [[user script]]s. 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! === Headers === ; [[Metadata Block|Metadata Block]] : Information about the script such as its name or version is encoded into comments by the script author. ; [[GM.info]] : Exposes this information (plus a bit more) to the user script. === Values === ; [[GM.deleteValue]] : Deletes a value from chrome that was previously set. ; [[GM.getValue]] : Retrieves stored values, see [[GM.setValue]] below. ; [[GM.listValues]] : Retrieves an array of stored values' keys. ; [[GM.setValue]] : Permanently stores a value under a key, later available via [[GM.getValue]]. === Resources === ; [[GM.getResourceUrl]] : Provides a URL for loading a <code>@resource</code>, such as an image, into the page. === Other === ; [[GM.notification]] : Opens a notification dialog. ; [[GM.openInTab]] : Opens a given URL in a new tab. ; [[GM.registerMenuCommand]] : Adds an item to the "User Script Commands" section of the [[Monkey Menu]]. ; [[GM.setClipboard]] : Sets the contents of the clipboard. ; [[GM.xmlHttpRequest]] : A variant of XMLHttpRequest, this method allows skipping use the same-origin policy, enabling complex mashups. ; [[unsafeWindow]] : This object provides access to the raw JavaScript <code>window</code> scope of the content page. It is most commonly used to access JavaScript variables on the page. [[Category:API Reference|*{{FULLPAGENAME}}]]
Summary:
Please note that all contributions to Greasespot Wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see
Greasespot Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Template:Greasemonkey Manual TOC
(
edit
)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main Page
Recent changes
Random page
Search
Tools
What links here
Related changes
Special pages
Page information