Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Firefox GCLI mdn command prototype
* mdn command
* use: mdn <query>
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 = "" + 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