MozillaZine

Automatically enable all addons

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

Post Posted March 2nd, 2018, 9:26 am

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: 2955
Joined: February 3rd, 2009, 6:29 pm

Post Posted March 2nd, 2018, 9:51 am

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.

therube

User avatar
 
Posts: 19194
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Post Posted March 2nd, 2018, 10:33 am

(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.])
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: 72
Joined: August 8th, 2008, 4:01 pm

Post Posted March 5th, 2018, 4:59 pm

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: 2955
Joined: February 3rd, 2009, 6:29 pm

Post Posted March 5th, 2018, 11:07 pm

milomak wrote:Do I have to run this every time?

No. The addons settings are carried over to future sessions.

milomak
 
Posts: 72
Joined: August 8th, 2008, 4:01 pm

Post Posted March 7th, 2018, 4:05 pm

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?

therube

User avatar
 
Posts: 19194
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Post Posted March 8th, 2018, 9:38 am

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?

viewtopic.php?p=14794173#p14794173
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: 2955
Joined: February 3rd, 2009, 6:29 pm

Post Posted March 8th, 2018, 10:49 am

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: 72
Joined: August 8th, 2008, 4:01 pm

Post Posted March 15th, 2018, 8:49 am

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: 2955
Joined: February 3rd, 2009, 6:29 pm

Post Posted March 21st, 2018, 4:11 am

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: 72
Joined: August 8th, 2008, 4:01 pm

Post Posted March 23rd, 2018, 11:22 am

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: 2955
Joined: February 3rd, 2009, 6:29 pm

Post Posted March 23rd, 2018, 1:07 pm

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: 72
Joined: August 8th, 2008, 4:01 pm

Post Posted March 23rd, 2018, 4:14 pm

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: 72
Joined: August 8th, 2008, 4:01 pm

Post Posted March 23rd, 2018, 4:21 pm

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: 2955
Joined: February 3rd, 2009, 6:29 pm

Post Posted March 23rd, 2018, 9:43 pm

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.

Return to Firefox Support


Who is online

Users browsing this forum: No registered users and 12 guests