Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disable firefox extension programmatically

I'm having a problem trying to disable Firefox extensions programmatically. Right now, I'm modifying the extension.json file , changing the 2 parameters , active and userDisabled , but without any success. Despite the fact that in the extension menu it appears to be disabled , the icon of extensions still appear in the toolbar and I can see that the extensions still work. Is there a way to make this work using C++ ?

like image 664
monfort Avatar asked Mar 13 '26 08:03

monfort


1 Answers

That won't work you have to use AddonManager.jsm to change the property like this:

Cu.import('resource://gre/modules/AddonManager.jsm');
AddonManager.getAddonByID('Profilist@jetpack', function(addon) { //id of the addon
  console.info('addon:', addon);
  addon.userDisabled = false; //set to true to enable it
});
like image 155
Noitidart Avatar answered Mar 14 '26 21:03

Noitidart



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!