Automatically enable all addons

User Help for Mozilla Firefox
Locked
milomak
Posts: 79
Joined: August 8th, 2008, 4:01 pm

Automatically enable all addons

Post by milomak »

Is there a way that I can get FF to automatically do this for all addons that have enable available as a feature?
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: Automatically enable all addons

Post by morat »

You can enable addons using the browser console.

Code: Select all

AddonManager.getAddonsByTypes(["extension"], function (addons) {
  addons.forEach(function (addon) {
    if (addon.userDisabled == true) addon.userDisabled = false;
  });
});
Instructions:

* open about:debugging and enable addon debugging
* open browser console (ctrl+shift+j) in tools > web developer
* copy and paste code into browser console
* press enter to run

Browser Console command line
http://developer.mozilla.org/en-US/docs ... mmand_line

Addon object properties
https://developer.mozilla.org/en-US/doc ... properties
Last edited by morat on March 2nd, 2018, 11:12 pm, edited 2 times in total.
User avatar
therube
Posts: 21703
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: Automatically enable all addons

Post by therube »

(Why double vs single = ? == vs = ?
And this, Equality comparisons and sameness, talks about == vs ===.
And I never knew you could have +0 & -0.

Oh, so it's this, What is the difference between = (Assignment) and == (Equal to) operators in C. [I should have known that.])
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
milomak
Posts: 79
Joined: August 8th, 2008, 4:01 pm

Re: Automatically enable all addons

Post by milomak »

morat wrote:You can enable addons using the browser console.

Code: Select all

AddonManager.getAddonsByTypes(["extension"], function (addons) {
  addons.forEach(function (addon) {
    if (addon.userDisabled == true) addon.userDisabled = false;
  });
});
Instructions:

* open about:debugging and enable addon debugging
* open browser console (ctrl+shift+j) in tools > web developer
* copy and paste code into browser console
* press enter to run

Browser Console command line
http://developer.mozilla.org/en-US/docs ... mmand_line

Addon object properties
https://developer.mozilla.org/en-US/doc ... properties
do i have to run this every time?
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: Automatically enable all addons

Post by morat »

milomak wrote:Do I have to run this every time?
No. The addons settings are carried over to future sessions.
milomak
Posts: 79
Joined: August 8th, 2008, 4:01 pm

Re: Automatically enable all addons

Post by milomak »

I'm not sure what has happened with Quantum.

I used to share the same profile across Windows/Linux/OSX (For so many FF releases)

Quantum has seemingly killed this. I am running the same version cross the distros. Yet when I open in each distro, I have to enable the extensions again. This is not something that was an issue pre-Quantum

What can I provide to make Quantum as good as things were before?
User avatar
therube
Posts: 21703
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: Automatically enable all addons

Post by therube »

Yet when I open in each distro, I have to enable the extensions again. This is not something that was an issue pre-Quantum
?
Also, extensions.ini & extensions.json store OS specific paths & I gather that is the reason for your reinstall prompts?
Perhaps run a script to rename those two files with appropriate copies of same for each OS prior to running SeaMonkey.
See if that accomplishes anything?
http://forums.mozillazine.org/viewtopic ... #p14794173
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: Automatically enable all addons

Post by morat »

The addonStartup.json.lz4 file contains path info as well.

Extensions Break On Path Change
http://github.com/MrAlex94/Waterfox/issues/329

Shared profile between operating systems keeps disabling addons
http://support.mozilla.org/en-US/questions/1182719

Decompress .lz4 files (chosen solution works in Fx 58)
http://support.mozilla.org/en-US/questions/1157315
milomak
Posts: 79
Joined: August 8th, 2008, 4:01 pm

Re: Automatically enable all addons

Post by milomak »

morat wrote: Shared profile between operating systems keeps disabling addons
http://support.mozilla.org/en-US/questions/1182719
this will be it. pity profile sharing was working without issue in ff52 esr
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: Automatically enable all addons

Post by morat »

Try running the above code using the browser console to see if it works correctly and then...

You could try using a userChrome.js hack to automatically run the code at startup. (for advanced users only)

Firefox Quantum compatible userChrome.js
http://github.com/Sporif/firefox-quantum-userchromejs

* ProfileSharingWorkaround.uc.js

Code: Select all

(function () {
  if (location != "chrome://browser/content/browser.xul") return;

  setTimeout(function () {
    AddonManager.getAddonsByTypes(["extension"], function (addons) {
      addons.forEach(function (addon) {
        if (addon.userDisabled == true) addon.userDisabled = false;
      });
    });
  }, 1000);
})();
milomak
Posts: 79
Joined: August 8th, 2008, 4:01 pm

Re: Automatically enable all addons

Post by milomak »

morat wrote:Try running the above code using the browser console to see if it works correctly and then...

You could try using a userChrome.js hack to automatically run the code at startup. (for advanced users only)

Firefox Quantum compatible userChrome.js
http://github.com/Sporif/firefox-quantum-userchromejs

* ProfileSharingWorkaround.uc.js

Code: Select all

(function () {
  if (location != "chrome://browser/content/browser.xul") return;

  setTimeout(function () {
    AddonManager.getAddonsByTypes(["extension"], function (addons) {
      addons.forEach(function (addon) {
        if (addon.userDisabled == true) addon.userDisabled = false;
      });
    });
  }, 1000);
})();
created a chrome folder in my firefox profile (directory eg c:\firefox\<profile>\chrome\)
copied the 3 files from the github link into that folder
is it then a simple case of creating ProfileSharingWorkaround.uc.js and paste the code into that file (which will also be in the chrome folder)
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: Automatically enable all addons

Post by morat »

You need to copy the userChrome.css and userChrome.xml files from the github link, not the userChrome.js file.

You need to create the ProfileSharingWorkaround.uc.js file with the given code.

You need to restart the application to make a change take effect.

You don't need to purge the javascript caches.

i.e.

firefox.exe -purgecaches
FirefoxPortable.exe -purgecaches
milomak
Posts: 79
Joined: August 8th, 2008, 4:01 pm

Re: Automatically enable all addons

Post by milomak »

So my FF profile:
Win10 C:\profiles\firefox\
Linux /mnt/ssd/profiles/firefox

in that folder created chrome

Code: Select all

$ ls -la /mnt/ssd/profiles/firefox/ | grep chrome
drwxrwxrwx 1 root root     4096 Mar 24 00:34 chrome
with files

Code: Select all

/mnt/ssd/profiles/firefox $ ls -lah /mnt/ssd/profiles/firefox/chrome
total 133K
drwxrwxrwx 1 root root 4.0K Mar 24 00:34 .
drwxrwxrwx 1 root root  40K Mar 24 01:07 ..
-rwxrwxrwx 2 root root  331 Mar 23 20:23 ProfileSharing.uc.js.txt
-rwxrwxrwx 2 root root  37K Mar 23 20:16 userChrome.css
-rwxrwxrwx 2 root root  48K Mar 23 20:16 userChrome.xml
let's see if it's because i did the edit in windowndows now i've removed .txt
milomak
Posts: 79
Joined: August 8th, 2008, 4:01 pm

Re: Automatically enable all addons

Post by milomak »

so even after txt removed, moving from linux to windows means i still need to run the script

and i even make sure this is the last tab i'm on :D :roll:
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: Automatically enable all addons

Post by morat »

It works for me in Windows.

I disabled an addon and restarted the browser, then I opened the addon page to see that the addon was enabled.
Locked