←back to thread

1318 points xvector | 7 comments | | HN request time: 0s | source | bottom
Show context
gpm ◴[] No.19824410[source]
To re-enable all disabled non-system addons you can do the following. I am not responsible if this fucks up your install:

Open the browser console by hitting ctrl-shift-j

Copy and paste the following code, hit enter. Until mozilla fixes the problem you will need to redo this once every 24 hours:

    // Re-enable *all* extensions

    async function set_addons_as_signed() {
        Components.utils.import("resource://gre/modules/addons/XPIDatabase.jsm");
        Components.utils.import("resource://gre/modules/AddonManager.jsm");
        let addons = await XPIDatabase.getAddonList(a => true);

        for (let addon of addons) {
            // The add-on might have vanished, we'll catch that on the next startup
            if (!addon._sourceBundle.exists())
                continue;

            if( addon.signedState != AddonManager.SIGNEDSTATE_UNKNOWN )
                continue;

            addon.signedState = AddonManager.SIGNEDSTATE_NOT_REQUIRED;
            AddonManagerPrivate.callAddonListeners("onPropertyChanged",
                                                    addon.wrapper,
                                                    ["signedState"]);

            await XPIDatabase.updateAddonDisabledState(addon);

        }
        XPIDatabase.saveChanges();
    }

    set_addons_as_signed();
Edit: Cleanup up code slightly...
replies(13): >>19824419 #>>19824512 #>>19824757 #>>19824939 #>>19825095 #>>19825736 #>>19826031 #>>19826062 #>>19826188 #>>19826298 #>>19826513 #>>19827530 #>>19829476 #
BlackPlatypus ◴[] No.19829476[source]
This does not work for FF versions older than v57.

I use v56.0.2 because that was the last time we actually got to customize the browser (yes, boo me for using an old version).

So I dug around a little (okay, a lot) and worked out a solution for v <= 56.

Version for FF v <= 56

  // For FF < v57 >...?
  async function set_addons_as_signed() {
      Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm");
      Components.utils.import("resource://gre/modules/AddonManager.jsm");
      let XPIDatabase = this.XPIInternal.XPIDatabase;
      
      let addons = await XPIDatabase.getAddonList(a => true);
  
      for (let addon of addons) {
          // The add-on might have vanished, we'll catch that on the next startup
          if (!addon._sourceBundle.exists())
              continue;
  
          if( addon.signedState != AddonManager.SIGNEDSTATE_UNKNOWN )
              continue;
  
          addon.signedState = AddonManager.SIGNEDSTATE_NOT_REQUIRED;
          AddonManagerPrivate.callAddonListeners("onPropertyChanged",
                                                  addon.wrapper,
                                                  ["signedState"]);
  
          await XPIProvider.updateAddonDisabledState(addon);
  
      }
      XPIDatabase.saveChanges();
  }
  
  set_addons_as_signed();
Please let me know which versions are compatible, and where it breaks down!

Don't forget to enable devtools.chrome.enabled in about:config and use the actual browser console, not the web console

replies(2): >>19829591 #>>19831556 #
gpm ◴[] No.19829591[source]
Hey, so if you're going to do this, you're porting the wrong code. My code (which you ported) will need to be rerun every 24h to reset the signing state (assuming old firefox works like new firefox, it probably does). You should figure out how to make the following code (pulled from the .xpi mozilla created) work in firefox 56's browser console instead:

    /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "skeleton" }]*/
    ChromeUtils.defineModuleGetter(this, "XPIDatabase", "resource://gre/modules/addons/XPIDatabase.jsm");

    var skeleton = class extends ExtensionAPI {
        getAPI(/* context */) {
            return {
                experiments: {
                    skeleton: {
                        async doTheThing() {
                            // first inject the new cert
                            try {
                                let intermediate = "MIIHLTCCBRWgAwIBAgIDEAAIMA0GCSqGSIb3DQEBDAUAMH0xCzAJBgNVBAYTAlVTMRwwGgYDVQQKExNNb3ppbGxhIENvcnBvcmF0aW9uMS8wLQYDVQQLEyZNb3ppbGxhIEFNTyBQcm9kdWN0aW9uIFNpZ25pbmcgU2VydmljZTEfMB0GA1UEAxMWcm9vdC1jYS1wcm9kdWN0aW9uLWFtbzAeFw0xNTA0MDQwMDAwMDBaFw0yNTA0MDQwMDAwMDBaMIGnMQswCQYDVQQGEwJVUzEcMBoGA1UEChMTTW96aWxsYSBDb3Jwb3JhdGlvbjEvMC0GA1UECxMmTW96aWxsYSBBTU8gUHJvZHVjdGlvbiBTaWduaW5nIFNlcnZpY2UxJjAkBgNVBAMTHXNpZ25pbmdjYTEuYWRkb25zLm1vemlsbGEub3JnMSEwHwYJKoZIhvcNAQkBFhJmb3hzZWNAbW96aWxsYS5jb20wggIiMA0GCSqGSIb3DQEBAQUA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GCWCGSAGG+EIBBAQmFiRodHRwOi8vYWRkb25zLm1vemlsbGEub3JnL2NhL2NybC5wZW0wTgYDVR0eBEcwRaFDMCCCHi5jb250ZW50LXNpZ25hdHVyZS5tb3ppbGxhLm9yZzAfgh1jb250ZW50LXNpZ25hdHVyZS5tb3ppbGxhLm9yZzANBgkqhkiG9w0BAQwFAAOCAgEAX1PNli/zErw3tK3S9Bv803RV4tHkrMa5xztxzlWja0VAUJKEQx7f1yM8vmcQJ9g5RE8WFc43IePwzbAoum5F4BTM7tqM//+e476F1YUgB7SnkDTVpBOnV5vRLz1Si4iJ/U0HUvMUvNJEweXvKg/DNbXuCreSvTEAawmRIxqNYoaigQD8x4hCzGcVtIi5Xk2aMCJW2K/6JqkN50pnLBNkPx6FeiYMJCP8z0FIz3fv53FHgu3oeDhi2u3VdONjK3aaFWTlKNiGeDU0/lr0suWfQLsNyphTMbYKyTqQYHxXYJno9PuNi7e1903PvM47fKB5bFmSLyzB1hB1YIVLj0/YqD4nz3lADDB91gMBB7vR2h5bRjFqLOxuOutNNcNRnv7UPqtVCtLF2jVb4/AmdJU78jpfDs+BgY/t2bnGBVFBuwqS2Kult/2kth4YMrL5DrURIM8oXWVQRBKxzr843yDmHo8+2rqxLnZcmWoe8yQ41srZ4IB+V3w2TIAd4gxZAB0Xa6KfnR4D8RgE5sgmgQoK7Y/hdvd9Ahu0WEZI8Eg+mDeCeojWcyjF+dt6c2oERiTmFTIFUoojEjJwLyIqHKt+eApEYpF7imaWcumFN1jR+iUjE4ZSUoVxGtZ/Jdnkf8VVQMhiBA+i7r5PsfrHq+lqTTGOg+GzYx7OmoeJAT0zo4c=";
                                let certDB = Cc["@mozilla.org/security/x509certdb;1"].getService(Ci.nsIX509CertDB);
                                certDB.addCertFromBase64(intermediate, ",,");
                                console.log("new intermediate certificate added");
                            } catch (e) {
                                console.error("failed to add new intermediate certificate:", e);
                            }

                            // Second, force a re-verify of signatures
                            try {
                                XPIDatabase.verifySignatures();
                                console.log("signatures re-verified");
                            } catch (e) {
                                console.error("failed to re-verify signatures:", e);
                            }
                        }
                    }
                }
            };
        }
    };
replies(1): >>19829632 #
1. BlackPlatypus ◴[] No.19829632{3}[source]
Oh, thank you for the pointer in the right direction! In the mean time, I was just glad to have any way to use my browser again!
replies(1): >>19830547 #
2. BlackPlatypus ◴[] No.19830547[source]
In the mean time, installing the hotfix extension and running the script seems to help :)
replies(2): >>19831309 #>>19832669 #
3. ghost2021a ◴[] No.19831309[source]
I LOVE YOU SO MUCH. Firm 56.0.2 user here as well. Refuse to go with a newer version. I don't even care that we're basically putting it on life-support at this point. Anyway thanks for the help. Couldn't stand youtube or basically any other website without adblock.
replies(1): >>19862995 #
4. Geralt28 ◴[] No.19832669[source]
I also using 56.0.2 (64 bit). Can you help me finding solution? I am on different date now to use FF, but I am already 2 days in the past. I tried to use your script and have: "// For FF < v57 >...? async function set_addons_as_signed() { Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm"); Components.utils.import("resource://gre/modules/AddonManager.jsm"); let XPIDatabase = this.XPIInternal.XPIDatabase;

      let addons = await XPIDatabase.getAddonList(a => true);
  
      for (let addon of addons) {
          // The add-on might have vanished, we'll catch that on the next startup
          if (!addon._sourceBundle.exists())
              continue;
  
          if( addon.signedState != AddonManager.SIGNEDSTATE_UNKNOWN )
              continue;
  
          addon.signedState = AddonManager.SIGNEDSTATE_NOT_REQUIRED;
          AddonManagerPrivate.callAddonListeners("onPropertyChanged",
                                                  addon.wrapper,
                                                  ["signedState"]);
  
          await XPIProvider.updateAddonDisabledState(addon);
  
      }
      XPIDatabase.saveChanges();
  }
  
  set_addons_as_signed();
Promise { <state>: "pending" }"

EDIT: have this one now: ado.config({ consent: true }); inpl.anc.js:40

Also what hotfix you refer too. I can not install hotfix-update-xpi-intermediate@mozilla.com-1.0.2-signed.xpi on old version :/

EDIT2: Installed this fix using debuging but it is not for a old FF and got some errors:

Reading manifest: Error processing hidden: An unexpected property was found in the WebExtension manifest. Reading manifest: Error processing experiment_apis: An unexpected property was found in the WebExtension manifest.

replies(2): >>19832811 #>>19832814 #
5. Geralt28 ◴[] No.19832811{3}[source]
I installed hotfix-update-xpi-intermediate@mozilla.com-1.0.2-signed.xpi as temporary extension and then was able somehow to install it in standard way.
6. gpm ◴[] No.19832814{3}[source]
Someone else posted this link https://www.reddit.com/r/firefox/comments/bkspmk/addons_fix_...

I can't really vouch for it, but sounds like it worked for them.

7. BlackPlatypus ◴[] No.19862995{3}[source]
Heheh, more like they've taken it OFF support - but anyways, have you seen the way to install Mozilla's intermediate certificate on older versions? It seems like that one actually solves it! :)))

https://www.reddit.com/r/firefox/comments/bkspmk/addons_fix_...