GM.getResourceText

From GreaseSpot Wiki
Revision as of 06:34, 15 December 2010 by 123.238.10.74 (talk)
Jump to navigationJump to search


Description

Given a defined @resource, this method returns it as a string.

Compatibility: Greasemonkey 0.8.0+

Syntax

function GM_getResourceText( resourceName )

Arguments

resourceName
String The name provided when the @resource was defined, follow that link for valid naming restrictions.

Returns

String

Raises

Throws an Error when the named resource does not exist.

Examples

// ==UserScript==
// @resource prototype http://1.bp.blogspot.com/_ejvSFUB_LBU/TIMOMxMUngI/AAAAAAAADHs/d5aalVCV1GA/s1600/lord-ganesh.JPG
// ==/UserScript==

var prototypeSource = GM_getResourceText("prototype");

See Also