GM.getResourceText: Difference between revisions
From GreaseSpot Wiki
Jump to navigationJump to search
m Text replace - "top " to "" |
Update for 4.0 |
||
(11 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
As of Greasemonkey 4.0, this method does not exist. | |||
<!-- Original text, in case 4.x restores this method? | |||
== Description == | == Description == | ||
Given a defined [[Metadata Block#.40resource|@resource]], this method returns it as a string. | |||
Compatibility: [[Version_history#0.8.20080609.0|Greasemonkey 0.8.0+]] | |||
== Syntax == | == Syntax == | ||
{{Function|GM_getResourceText|resourceName}} | |||
=== Arguments === | |||
; resourceName | |||
: <code>String</code> The name provided when the [[Metadata Block#.40resource|@resource]] was defined, follow that link for valid naming restrictions. | |||
=== Returns === | |||
<code>String</code> | |||
=== | === Raises === | ||
Throws an <code>Error</code> when the named resource does not exist. | |||
== Examples == | == Examples == | ||
<pre class='sample'> | |||
// ==UserScript== | // ==UserScript== | ||
// @resource prototype http://www.example.com/prototype.js | |||
// @resource | |||
// ==/UserScript== | // ==/UserScript== | ||
( | var prototypeSource = GM_getResourceText("prototype"); | ||
</pre> | |||
== See Also == | |||
* [[GM_getResourceURL]] | |||
[[Category:API_Reference|G]] | [[Category:API_Reference|G]] | ||
--> |
Latest revision as of 14:33, 3 November 2017
As of Greasemonkey 4.0, this method does not exist.