←back to thread

1318 points xvector | 1 comments | | HN request time: 1.17s | 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 #
ihoonte ◴[] No.19827958[source]
66.0.3 (64-bit) osx 10.9.5 i only managed to change the status of devtools.chrome.enabled can only be 'modified' instead of default, not sure how you 'enable' it? new to this :) clicking or copy pasting the link gives me the error msg too
replies(2): >>19828020 #>>19828143 #
gpm ◴[] No.19828143[source]
When I say "enabled" I mean set to a value of "true" (instead of "false"), "modified" is a different column.

What error do you get on the link though? That link is a better fix.

replies(1): >>19828184 #
ihoonte ◴[] No.19828184[source]
Ah okay yeah I set it to true, default was false. Error is connection failure (same error as for the add-ons)
replies(2): >>19828218 #>>19828221 #
gpm ◴[] No.19828218[source]
Not sure what would be causing a connection failure. I just verified that the link is still up for me, and obviously you have an internet connection if you're replying to me.

You're not behind a firewall that might be blocking it are you? E.g. being in China?

replies(4): >>19828263 #>>19828285 #>>19828324 #>>19828447 #
arrivance ◴[] No.19828447[source]
I can report a connection failure while being on a unrestricted connection (University internet in the UK).
replies(1): >>19828500 #
gpm ◴[] No.19828500[source]
So, I don't have any good ideas why. Can you give me more information about what exactly happens? Can't promise anything but details might help.

I.e. something like

- I open the browser console

- I click the .xpi link

- The following appears in the browser console immediately after clicking the link:

    WebExtensions: new intermediate certificate added api.js:15
    WebExtensions: signatures re-verified api.js:23
- My addons do not come back

- If I try to install an addon from addons.mozilla.org I get <this message about the addon signature verification failing> in the browser console.

replies(1): >>19828634 #
arrivance ◴[] No.19828634[source]
Thanks for the response!

So,

I click the link. I click "Add", and Mozilla says addon could not be downloaded due to connection failure. Nothing appears in browser console.

Downloading an addon gives me "Download failed. Please check your connection." on the Addons site. In console, I get:

  Events to handle the installation initialized. BigInteger.js:27
  [GA: OFF] sendEvent {"hitType":"event","eventCategory":"AMO Addon Installs Download Failed","eventAction":"addon","eventLabel":"uBlock Origin"} BigInteger.js:27
  Error:
In the studies, I have https://i.imgur.com/fqrd5Jo.png. I enabled it, and have tried setting both first run, and the update interval is set to 21 (to try and force it to update it quickly).
replies(1): >>19828669 #
gpm ◴[] No.19828669[source]
Hmm, what happens if you right click and save-link-as on the .xpi link? Or if you download it via curl or wget or something?

Edit: That studies image looks like it has already been installed, which is weird if your extensions aren't back...

replies(1): >>19828756 #
arrivance ◴[] No.19828756[source]
OK, so... I right clicked, saved-as and then ran the XPI... and that worked. So thank you for that suggestion.

As for the studies image, that's only half of the fix according to the blog post [1], mine is only verification-timestamp, not signing-intermediate-bug.

[1]: https://blog.mozilla.org/addons/2019/05/04/update-regarding-...

replies(1): >>19828803 #
1. gpm ◴[] No.19828803[source]
Glad to hear it worked.

You're right about the image, that's weird, I can't think of any reason why the verification-timestamp one would be necessary.