Created
January 20, 2009 02:30
-
-
Save tsukkee/49287 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
js <<EOM | |
commands.addUserCommand(["javascriptincontent", "jsc"], | |
"Run a JavaScript command in content context", | |
function (args) | |
{ | |
try | |
{ | |
let s = new Components.utils.Sandbox(buffer.URL); | |
s.window = content.window; | |
s.document = content.document; | |
// s.__proto__ = content.window.wrappedJSObject; | |
return Components.utils.evalInSandbox(args.string, s); | |
} | |
catch (e) | |
{ | |
liberator.echoerr(e); | |
} | |
}, | |
{ | |
completer: function (context) completion.javascript(context), | |
hereDoc: true, | |
literal: 0 | |
}); | |
EOM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment