Reputation: 23323
I use simple-prefs module to configure addon settings. How can I programmatically open addon's settings page?
Upvotes: 4
Views: 328
Reputation: 16528
We do this in a test add-on here
There is more code there than you need though, so the shorter version is:
const self = require('sdk/self');
const tabs = require('sdk/tabs');
tabs.open({
url: 'about:addons',
onReady: function(tab) {
tab.attach({
contentScriptWhen: 'end',
contentScript: 'AddonManager.getAddonByID("' + self.id + '", function(aAddon) {\n' +
'unsafeWindow.gViewController.commands.cmd_showItemDetails.doCommand(aAddon, true);\n' +
'});\n'
});
}
});
In words, this opens the about:addons
page in a new tab, waits for it to load, then opens the details page for your add-on.
Upvotes: 7