Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Has FF Addon SDK an API to open settings page?

I use simple-prefs module to configure addon settings. How can I programmatically open addon's settings page?

like image 796
fedor.belov Avatar asked Oct 17 '25 10:10

fedor.belov


1 Answers

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.

like image 189
erikvold Avatar answered Oct 19 '25 13:10

erikvold



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!