GM_getResourceText

From GreaseSpot

Jump to: navigation, search


Contents

[edit] Description

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

Compatibility: Greasemonkey 0.8.0+

[edit] Syntax

function GM_getResourceText( resourceName )

[edit] Arguments

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

[edit] Returns

String

[edit] Raises

Throws an Error when the named resource does not exist.

[edit] Examples

// ==UserScript==
// @resource prototype http://www.example.com/prototype.js
// ==/UserScript==

var prototypeSource = GM_getResourceText("prototype");

[edit] See Also

Personal tools