←back to thread

1318 points xvector | 3 comments | | HN request time: 0s | source
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 #
leon22 ◴[] No.19826062[source]
// 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();
replies(1): >>19826874 #
igivanov ◴[] No.19826874[source]
TypeError: Components.utils is undefined[Learn More]

what did I do wrong? (It's all Greek to me)

replies(1): >>19826903 #
gpm ◴[] No.19826903[source]
What version of firefox are you running?

Apparently beta and nightly need to change `Components.utils.import` to `ChromeUtils.import`.

But anyways, don't use this now, use the semi-official fix of clicking on this link and letting it install: https://storage.googleapis.com/moz-fx-normandy-prod-addons/e...

This is the fix Mozilla has published to be installed via shield studies, but skipping the shield studies part. You can be sure it's not malicious because it is signed by Mozilla... and if your browser installed unsigned extensions you wouldn't be looking for this solution in the first place.

replies(43): >>19826914 #>>19827772 #>>19827810 #>>19827818 #>>19827857 #>>19827897 #>>19827921 #>>19827958 #>>19828018 #>>19828116 #>>19828298 #>>19828425 #>>19828451 #>>19828536 #>>19828601 #>>19828705 #>>19828732 #>>19828877 #>>19829123 #>>19829240 #>>19829533 #>>19829848 #>>19831009 #>>19831187 #>>19831360 #>>19831455 #>>19831797 #>>19832581 #>>19832743 #>>19833096 #>>19833522 #>>19833610 #>>19833774 #>>19836075 #>>19837384 #>>19838847 #>>19839425 #>>19840363 #>>19844475 #>>19847894 #>>19857538 #>>19861568 #>>19873631 #
igivanov ◴[] No.19826914{3}[source]
66.0.2 (64-bit), Win 10
replies(1): >>19826935 #
gpm ◴[] No.19826935{4}[source]
Maybe you pasted it in the wrong console? You need the 'browser console' which is different from the one you open on random webpages.

Go to "about:config" (in the url bar), search for and enable devtools.chrome.enabled, then hit ctrl-shift-j (or you can open it from Menu -> Web Developer -> Browser Console).

replies(1): >>19827008 #
1. igivanov ◴[] No.19827008{5}[source]
Ha! That did the trick! Though it gave me these cryptic errors the add-ons are now enabled, thanks!

TypeError: setting is undefined[Learn More] ExtensionPreferencesManager.jsm:90:7 No matching message handler for the given recipient. MessageChannel.jsm:924 1556983316679 addons.xpi-utils WARN Add-on fxmonitor@mozilla.org is not correctly signed.

Edit: another weirdness: i decided to take a look at a different computer (unrelated to this one, at work via remote desktop) which is running exactly the same FF and Windows and all add-on are enabled. it's on 24x7; i didn't do anything to it.

replies(2): >>19827058 #>>19828890 #
2. gpm ◴[] No.19827058[source]
That's an expected error, it has to do with how that addon (which is non critical but published by mozilla and really just a part of firefox) is installed, once mozilla publishes a new version of firefox with an updated signing key it should fix itself.
3. gpm ◴[] No.19828890[source]
As for your other weirdness. Signatures are only checked once every 24 hours, and it's only been 20 since the cert expired, your other computer probably just hasn't re-verified the signatures yet. You can find some comments here about how to delay it if you want.