Skip to content

Instantly share code, notes, and snippets.

@VKen
Last active March 19, 2025 00:38
Show Gist options
  • Save VKen/3e667a2016cc8e8296bd87e28d8a8f74 to your computer and use it in GitHub Desktop.
Save VKen/3e667a2016cc8e8296bd87e28d8a8f74 to your computer and use it in GitHub Desktop.
Re-enable disabled firefox extensions addons 2025-03-15

Re-enable all firefox's disabled extensions addons 2025-03-15

RUN THIS SCRIPT AT YOUR OWN RISK

This is for addons signature expiry of firefox in 2025-03-15. Not recommended unless you understand the security risks.

If you are not running Firefox ESR with xpinstall.signatures.required set to false i.e. normal firefox, then you have some steps to follow first to tweak your firefox, your OS's methods may vary:

This script is to be run in firefox developer console.

Works for some newer version (2024+) of firefox, so you may have to tweak as needed for your firefox version e.g. ChromeUtils to Components.

  • may need to run special developer console Ctrl-Shift-J
  • may need to set devtools.chrome.enabled to true in about:config

credits goes to:

unsigned addons 24 hours validity due to automatic re-verify

Addons may be automaticallly re-verified and re-disabled due to default timer of 24 hours set in the settings.

You may want to find const XPI_SIGNATURE_CHECK_PERIOD = 24 * 60 * 60; in omni.ja's ./modules/addons/XPIProvider.jsm to edit accordingly.

You may also want to look at verifySignatures() in omni.ja's ./modules/addons/XPIPDatabase.jsm

You may need to find the files in other locations in different version of firefox.

Some users reported that in certain firefox versions, the edits to omni.ja doesn't work, as there's a precompiled version somewhere.

credits: https://www.reddit.com/r/firefox/comments/1jbhi1v/comment/mi243z7/

RUN THIS SCRIPT AT YOUR OWN RISK

// Re-enable *all* extensions
// ==
// *RUN THIS SCRIPT AT YOUR OWN RISK*
//
// if you are not running Firefox ESR with `xpinstall.signatures.required` set to `false`,
// then you have some steps to follow first to tweak your firefox, your OS's methods may vary:
// - https://www.reddit.com/r/firefox/comments/1jbhi1v/comment/mhv0lst/
//
// This script is to be run in firefox developer console.
// Works for some newer version (2024+) of firefox, so you may have to tweak as needed
// for your firefox version e.g. `ChromeUtils` to `Components`.
// - may need to run special developer console `Ctrl-Shift-J`
// - may need to set `devtools.chrome.enabled` to `true` in `about:config`
// credits goes to:
// - https://www.reddit.com/r/firefox/comments/1jbhi1v/comment/mhv0lst/
// - https://news.ycombinator.com/item?id=19824410
//
// unsigned addons 24 hours validity
// ==
// Addons may be automaticallly re-verified and re-disabled due to default timer of 24 hours set in the settings.
// You may want to find `const XPI_SIGNATURE_CHECK_PERIOD = 24 * 60 * 60;` in `omni.ja`'s `./modules/addons/XPIProvider.jsm`
// to edit accordingly. You may also want to look at `verifySignatures()` in `omni.ja`'s `./modules/addons/XPIPDatabase.jsm`
// you may need to find the files in other locations in different version of firefox.
// some users reported that in certain firefox versions, the edits to omni.ja doesn't work, as there's a precompiled version somewhere.
// credits: https://www.reddit.com/r/firefox/comments/1jbhi1v/comment/mi243z7/
//
// *RUN THIS SCRIPT AT YOUR OWN RISK*
async function set_addons_as_signed() {
// original script, doesn't work in my version because object's components
// doesn't automatically get defined as an object in the current scope
//ChromeUtils.import("resource://gre/modules/addons/XPIDatabase.jsm");
//ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
// manually define the components in the current scope for components used later
const XPIDatabase = ChromeUtils.import("resource://gre/modules/addons/XPIDatabase.jsm").XPIDatabase;
const AddonManager = ChromeUtils.import("resource://gre/modules/AddonManager.jsm").AddonManager;
const AddonManagerPrivate = ChromeUtils.import("resource://gre/modules/AddonManager.jsm").AddonManagerPrivate;
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 && !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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment