←back to thread

1318 points xvector | 1 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 #
OzMerry ◴[] No.19831360[source]
"The add-on could not be downoaded because of a connection failure." <--- Grrrr!

Win 10 FF 66.0.3 64-bit (Studies checked by default anyway). In Australia.

replies(1): >>19832435 #
midlandsfirst ◴[] No.19832435[source]
right click, download to desktop. Drag it into your firefox window. It will install then.
replies(1): >>19837261 #
1. OzMerry ◴[] No.19837261[source]
Thank you!