GM.info

From GreaseSpot Wiki
Revision as of 15:57, 10 February 2012 by Arantius (talk | contribs) (Created page with "{{DISPLAYTITLE:GM_info}} == Description == An object that exposes various information about Greasemonkey and the running User Script. == Syntax == <pre class='sample'>GM_i...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Description

An object that exposes various information about Greasemonkey and the running User Script.

Syntax

GM_info

Returns

This object has the following properties:

script
An object containing data about the currently running script. See more detail below.
scriptMetaStr
A string, the entire literal Metadata Block (without the delimiters) for the currently running script.
scriptWillUpdate
A boolean; when true Greasemonkey will attempt to auto-update the script.
version
The version of Greasemonkey, a string e.g. 0.9.16.

The script object contains structured fields from the Metadata Block:

description
Possibly empty string.
excludes
Possibly empty array of strings.
includes
Possibly empty array of strings.
matches
Possibly empty array of strings. (Bug in 0.9.16.)
name
String.
namespace
Possibly empty string.
run-at
String.
unwrap
Boolean.
Version
Possibly empty string.