Skip to content

Instantly share code, notes, and snippets.

@toke
Last active November 15, 2017 17:29
Show Gist options
  • Save toke/8709cbec56ac1f8aa0d22f2313f86863 to your computer and use it in GitHub Desktop.
Save toke/8709cbec56ac1f8aa0d22f2313f86863 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Image resource example
// @resource logo ../icons/laptop.png
// @grant GM.getResourceUrl
// ==/UserScript==
(async function() {
let img = document.createElement("img");
img.src = await GM.getResourceUrl("logo");
document.body.appendChild(img);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment