Skip to content

GM_getResourceURL

erikvold edited this page · 2 revisions

Description

GM_getResourceURL retrieves a Base64-encoded data: URI of the resource specified in a Metadata Block's @resource key.

Arguments

String name

The name of the @resource to retrieve.

Returns

String

Example

// ==UserScript==
// @name         GM_getResourceText test
// @namespace    myCoolNamespace
// @include      *
// @resource     myImage http://www.mywebsite.com/myImage.png
// ==/UserScript==

var img = document.createElement("img");
img.src = GM_getResourceURL("myImage");
document.body.appendChild(img);

Related Pages

Manual: API

Something went wrong with that request. Please try again.