14 ms·
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 c
by gpm 8y ago
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...
- userbinator 8y agoI wonder how long until the "security vultures" come upon this workaround and stop it from working... would be ironic if that happened sooner than the expired cert getting fixed.
- floatingatoll 8y agoSeems unlikely. If you’re willing and able to run code like the above, sourced from a random comment on the Internet, there’s no amount of security vulture that’s going to protect you from skillfully making your Internet experience unsafe for yourself.
- bostik 8y agoIsn't that how most programming, security or not, works these days anyway? Joe Random Developer googles for a problem, hits SO, tries a couple of the different proposed snippets and keeps the one that happens to work. (For given values of "work".) This would be a great spot to end the post with a "</snark>", but sadly that'd be lying. Up until ~2 years ago the most common solution to requests between different subdomains subdomains failing was... "just use CORS: *"
- floatingatoll 8y agoI believe the Mozilla Observatory has given CORS: * a -50 score penalty since the day it launched, precisely because of how horrifically dangerous that advice is.
- adrianN 8y agoMore dangerous than copypasting code from SO is using some 0.0.1alpha library you found on Github/crates.io/npm... At least with the copypaste snippet you had a cursory look at the implementation.
- snazz 8y agoYou can even automate the procedure: https://gkoberger.github.io/stacksort/ https://gkoberger.github.io/stacksort/
- userbinator 8y agoIt doesn't stop them from trying, however, and severely damaging the experience of users who do know what they're doing. They even invented the term "self-XSS" and contributed to the decline of JS "bookmarklets".
- pepa65 8y agoI just set xpinstall.signatures.required to True in about:config and that fixed it after a restart.
- drewmol 8y agoFor me this is False ;-)
- dveditz_ 8y agoAre you using an Extended Support Release (ESR)? That's expected then.
- TheRealPomax 8y agobut only for dev/beta/nightly. Note that this won't work for the standard version of FF.
- ddtaylor 8y agoAFAIK that only works for the nighty/dev versions.
- gpm 8y agoCurious, that shouldn't work on branded stable installs.
- thekyle 8y agoIt works on Linux but not Windows or Mac installs. I assume that repo maintainers use different compiler options than the official Firefox binaries.
- brezelben 8y agoWorked for me on Linux, didn't even require a restart (some addons just reappeared immediately). Using Firefox from Ubuntu package management.
- pfeerick 8y agoI can confirm this on Ubuntu 19.04 with Firefox 66.0.3. Changing xpinstall.signatures.required from the default 'True' to 'False' resulted in addons working again.
- techwolf 8y agoMuch better, thanks! It's scripts like this that make me miss the old XUL addon interface; sure it was difficult to maintain, but it granted a level of control over the browser that wasn't (and now, sadly, isn't) possible anywhere else. I was able to piece together most of my compact dark interface theme [1] with userChrome.css by sacrificing the all-tabs menu for its JS binding, but the all-tabs helper addon is a shadow of what it once was, and the Private Tabs addon is dead with no hope of revival due to the lack of a WebExtension API [2]. I can't even switch browsers to get the functionality back since the others are even less configurable. [1]: https://github.com/techwolfy/rainfox-theme https://github.com/techwolfy/rainfox-theme [2]: https://bugzilla.mozilla.org/show_bug.cgi?id=1358058 https://bugzilla.mozilla.org/show_bug.cgi?id=1358058
- moho 8y agoSuper useful, thanks. In my case ctrl+shift+j opens a dumb console that only shows messages and doesn't take any input. I had to go to about:addons, hit F12 for the Dev Tools and paste it in the console there. Worked well.
- Rebelgecko 8y agoIf you go to about:config and set "devtools.chrome.enabled" to true, the cmd-shift-j thing should work
- leemailll 8y agoThis is the step required for me to allow Browser Console for input
- ezconnect 8y agoI also have to do this to make it work on Win10 firefox console (F12)
- wertyyuu 8y agoIf some addons DISAPPEARED then you have to restart Firefox, go to addon manager menu, find disappeared addons and disable/enable them. When I say "disappeared" I mean that addon icon or else is disappeared.
- greenyoda 8y agoThis worked like a charm. Thanks very much!
- deleted 8y ago[deleted]
- leon22 8y ago// 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();
- igivanov 8y agoTypeError: Components.utils is undefined[Learn More] what did I do wrong? (It's all Greek to me)
- gpm 8y agoWhat 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/extensions/hotfix-update-xpi-intermediate%40mozilla.com-1.0.2-signed.xpi 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.
- igivanov 8y ago66.0.2 (64-bit), Win 10
- look997 8y agoI recommend downloading the Firefox Unbranded version: https://wiki.mozilla.org/Add-ons/Extension_Signing#Unbranded_Builds https://wiki.mozilla.org/Add-ons/Extension_Signing#Unbranded... There you can change the options in `about:config` (these options do not work in the main version of Firefox) ` xpinstall.whitelist.required on false xpinstall.signatures.required on false extensions.legacy.enabled on true ` And then every extension works, even experimental and a large part of those based on the former API. In principle, the Firefox Unbranded version should be the most promoted because it has fewer restrictions on extensions. Even such a version with default options set in `about:config` should exist, and with a larger extension base than AMO.
- codeandbeer 8y agoThank you for this.
- Marc66FR 8y agoDoesn't work for me (latest FF on MacOS). I get TypeError: Componets.utils is undefined
- zyrox 8y agoSame here, with FFv66.0.3 on Arch. On FFv66.0.2 as well. Tried some suggestions I found on the internet, but no luck there either. #Edit: found you need to be on about:addons, then paste the code. Thanks!
- acqq 8y agoIf you're still not being hit, and if the browser console doesn't accept the input, is it enough to get from the WebConsole Math.floor( (new Date()).getTime()/1000 ) and paste the number in "app.update.lastUpdateTime.xpi-signature-verification" to be off the hook for the next 24 hours?
- gpm 8y agoUh... if that outputs a unix date yes (I think) except you need to restart the browser afterwards as well.
- acqq 8y ago> if that outputs a unix date yes Yes, the JavaScript's getTime() is in milliseconds since Jan 1 1970 and the C time_t (which is what I think is used as a timestamp) is in seconds.
- ipatmos 8y agoI used this code and it worked. However, I just received Mozilla fix. Do I need to now delete this code from the browser console?
- BlackPlatypus 8y agoThis 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
- gpm 8y agoHey, 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 = "MIIHLTCCBRWgAwIBAgIDEAAIMA0GCSqGSIb3DQEBDAUAMH0xCzAJBgNVBAYTAlVTMRwwGgYDVQQKExNNb3ppbGxhIENvcnBvcmF0aW9uMS8wLQYDVQQLEyZNb3ppbGxhIEFNTyBQcm9kdWN0aW9uIFNpZ25pbmcgU2VydmljZTEfMB0GA1UEAxMWcm9vdC1jYS1wcm9kdWN0aW9uLWFtbzAeFw0xNTA0MDQwMDAwMDBaFw0yNTA0MDQwMDAwMDBaMIGnMQswCQYDVQQGEwJVUzEcMBoGA1UEChMTTW96aWxsYSBDb3Jwb3JhdGlvbjEvMC0GA1UECxMmTW96aWxsYSBBTU8gUHJvZHVjdGlvbiBTaWduaW5nIFNlcnZpY2UxJjAkBgNVBAMTHXNpZ25pbmdjYTEuYWRkb25zLm1vemlsbGEub3JnMSEwHwYJKoZIhvcNAQkBFhJmb3hzZWNAbW96aWxsYS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC/qluiiI+wO6qGA4vH7cHvWvXpdju9JnvbwnrbYmxhtUpfS68LbdjGGtv7RP6F1XhHT4MU3v4GuMulH0E4Wfalm8evsb3tBJRMJPICJX5UCLi6VJ6J2vipXSWBf8xbcOB+PY5Kk6L+EZiWaepiM23CdaZjNOJCAB6wFHlGe+zUk87whpLa7GrtrHjTb8u9TSS+mwjhvgfP8ILZrWhzb5H/ybgmD7jYaJGIDY/WDmq1gVe03fShxD09Ml1P7H38o5kbF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Aoum5F4BTM7tqM//+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); } } } } }; } };