3 karma · joined May 4, 2019 (7y ago) · 4 submissions
comment 7y ago · link · parent
https://www.reddit.com/r/firefox/comments/bkspmk/addons_fix_...
comment 7y ago · link · parent
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