Created
June 29, 2012 04:52
-
-
Save jeffgca/3015860 to your computer and use it in GitHub Desktop.
Firefox GCLI mdn command prototype
This file contains hidden or 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
/* | |
* stackoverflow search command | |
* use: sof <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 = "http://stackoverflow.com/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