Create a gist now

Instantly share code, notes, and snippets.

Firefox GCLI loadscript command prototype
/*
* loadscript command
*/
gcli.addCommand({
name: 'loadscript',
description: 'Loads a JavaScript resource into the current page',
params: [
{
name: 'file',
type: 'string',
description: 'URL to script to load'
}
],
exec: function(args, context) {
let script = context.environment.contentDocument.createElement('script');
script.src = args.file;
context.environment.contentDocument.body.appendChild(script);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment