@grant

From GreaseSpot Wiki
Revision as of 22:01, 24 June 2012 by Arantius (talk | contribs)
Jump to navigationJump to search

This page describes features that are currently unreleased.

Greasemonkey 1.0 adds a special Metadata Block imperative: @grant. As of version 1.0:

  • If a script does not specify any @grant values, Greasemonkey will attempt to auto-detect the right settings.
  • If a script specifies any values (or they have been auto detected), then it will be provided with only those API methods that it declares.
    • The valid values are those GM_ prefixed values that you wish your script to be granted access to. Until the documentation is finished, take a look at sniffGrants.js which detects unspecified values.
  • Otherwise the script will be granted no special API privileges, and thus run without the security constraints Greasemonkey scripts have traditionally had. If you want your script to operate in this mode, you should explicitly declare @grant none.