Create a gist now

Instantly share code, notes, and snippets.

Firefox GCLI mdn command prototype
/*
* mdn command
* use: mdn <query>
*/
gcli.addCommand({
name: 'mdn',
description: 'Searches the Mozilla Developer Network',
params: [
{
name: 'query',
type: { name: 'array', subtype: 'string' },
description: 'Query to search for on MDN'
}
],
exec: function(args, context) {
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let url = "https://developer.mozilla.org/en-US/search?q=" + encodeURIComponent(args.query.join(' '));
gBrowser.selectedTab = gBrowser.addTab(url);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment