I use simple-prefs module to configure addon settings. How can I programmatically open addon's settings page?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With