3

I am trying to enable all extensions in private mode in Firefox without having to go into each addon. Is there a universal switch (or extension) of sorts that does this in one go?

I tried this but it is not working as expected. Extensions are still off in private mode.

Any help is greatly appreciated.

3 Answers 3

1

This used to be possible by setting in about:config the option on extensions.allowPrivateBrowsingByDefault to true.

However, the Firefox developers have recently decided to remove the feature.

In the article These Weeks in Firefox: Issue 96, it's said:

Sonia Singla contributed a patch to remove the about:config preference “extensions.allowPrivateBrowsingByDefault” (it has been introduced as a fallback mechanism to return to the older behavior, during the transition to the user-controlled extension permission to selectively allow extensions to run in private windows) – Bug 1661517

This same question was raised several times by users since then, but didn't find a sympathetic ear with the developers.

Negative answer: This is no longer possible, and it's by design, unfortunately.

5
  • How the mighty have fallen. Would you say Waterfox or Basilisk would be an alternative or are they fated to the same path?
    – Rashiq
    Aug 16, 2021 at 13:49
  • These Firefox clones follow their own paths, taking new features from Firefox only when they suit their view of the browser. I cannot answer whether they will follow Firefox in the future or not.
    – harrymc
    Aug 16, 2021 at 13:56
  • Firefox developers have made many decisions that drove away many users, myself included.
    – harrymc
    Aug 16, 2021 at 14:14
  • would you mind if ask what browser you're using or would recommend? Since I'm in the market for one because of Mozilla's shenanigans.
    – Rashiq
    Aug 18, 2021 at 18:06
  • I'm using Palemoon because it still supports the legacy add-ons that I like.
    – harrymc
    Aug 18, 2021 at 18:46
1

It is possible to enable all extensions in private mode, programmatically through the Browser Console.

First enable the command line of the Browser Console

Then execute the following snippet

(async()=>{
    const PRIVATE_BROWSING_PERMS = {
        permissions: ["internal:privateBrowsingAllowed"],
        origins: [],
    };
    const {ExtensionPermissions} = ChromeUtils.import("resource://gre/modules/ExtensionPermissions.jsm");
    const myaddons = await AddonManager.getAddonsByTypes(["extension"]);
    for(let addon of myaddons){
        let policy = WebExtensionPolicy.getByID(addon.id);
        let extension = policy && policy.extension;
        await ExtensionPermissions.add(addon.id, PRIVATE_BROWSING_PERMS, extension);
        if (addon.isActive)
            addon.reload();
    }
})();

Warning: Code executed from the Browser Console can bypass almost every security barrier. While the above snippet is quite straightforward, if you don't understand what a piece of code does, you should not trust strangers (that's me) telling you it's harmless to execute it from the Browser Console.

2
  • I have never seen such a solution for this problem. I am very grateful for the answer. ctrl+shift+j opens the browser console for vanilla firefox and firefox developer edition and the code works in them but I don't know how to run the code for firefox nightly since the caret never shows up in the console. Do you have any suggestion?
    – Rashiq
    Aug 18, 2021 at 18:04
  • Nightly is no different than release or devedition, in fact it is more permissive. Did you enable the command line?
    – paa
    Aug 19, 2021 at 8:57
1

You should be able to do this by editing extension-preferences.json in your Firefox profile. Here's mine:

{
  -- snip (a bunch of built-in extensions) --
  "[email protected]": {
    "permissions": [
      "internal:privateBrowsingAllowed"
    ],
    "origins": []
  }
}

Just add that permission to all of the extension entries (you could probably create a sed to automate this, or even just parse the JSON).

I hope Mozilla considers bringing back the extensions.allowPrivateBrowsingByDefault option. Their removal of it is complete security theater and won't stop any bad actors from programmatically enabling a malicious extension in private mode. What it does accomplish is making the job of sysadmins more difficult. It's also worth mentioning that I was able to find this out in all of 2 minutes by diffing (using Meld) the before and after of my Firefox profile - so I really hope this wasn't intended as a security barrier.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .