Created
January 26, 2014 22:01
-
-
Save Ventero/8640014 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name GM_getResourceText ScriptChannel behavior | |
// @namespace test | |
// @version 1.0 | |
// @include * | |
// @grant GM_getResourceText | |
// @grant GM_getResourceURL | |
// @resource script.user.js http://dump.ventero.de/greasemonkey/resource | |
// ==/UserScript== | |
if (typeof GM_getResourceText === "undefined") { | |
console.log("in content scope"); | |
} else { | |
console.log(GM_getResourceText("script.user.js")); | |
var s = document.createElement("script"); | |
s.src = GM_getResourceURL("script.user.js"); | |
// Expected result: the resource content will be evaluated, which would log | |
// "Example resource text" to the console. | |
// Actual result: this script's content will be evaluated, logging | |
// "in content scope" | |
document.body.appendChild(s); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment