5 ms·
This 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
by BlackPlatypus 8y ago
This 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 = "MIIHLTCCBRWgAwIBAgIDEAAIMA0GCSqGSIb3DQEBDAUAMH0xCzAJBgNVBAYTAlVTMRwwGgYDVQQKExNNb3ppbGxhIENvcnBvcmF0aW9uMS8wLQYDVQQLEyZNb3ppbGxhIEFNTyBQcm9kdWN0aW9uIFNpZ25pb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5sgmgQoK7Y/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); } } } } }; } };
- BlackPlatypus 8y agoOh, thank you for the pointer in the right direction! In the mean time, I was just glad to have any way to use my browser again!
- BlackPlatypus 8y agoIn the mean time, installing the hotfix extension and running the script seems to help :)
- ghost2021a 8y agoI LOVE YOU SO MUCH. Firm 56.0.2 user here as well. Refuse to go with a newer version. I don't even care that we're basically putting it on life-support at this point. Anyway thanks for the help. Couldn't stand youtube or basically any other website without adblock.
- BlackPlatypus 8y agoHeheh, more like they've taken it OFF support - but anyways, have you seen the way to install Mozilla's intermediate certificate on older versions? It seems like that one actually solves it! :))) https://www.reddit.com/r/firefox/comments/bkspmk/addons_fix_for_5602_older/ https://www.reddit.com/r/firefox/comments/bkspmk/addons_fix_...
- Geralt28 8y agoI also using 56.0.2 (64 bit). Can you help me finding solution? I am on different date now to use FF, but I am already 2 days in the past. I tried to use your script and have: "// 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(); Promise { <state>: "pending" }" EDIT: have this one now: ado.config({ consent: true }); inpl.anc.js:40 Also what hotfix you refer too. I can not install hotfix-update-xpi-intermediate@mozilla.com-1.0.2-signed.xpi on old version :/ EDIT2: Installed this fix using debuging but it is not for a old FF and got some errors: Reading manifest: Error processing hidden: An unexpected property was found in the WebExtension manifest. Reading manifest: Error processing experiment_apis: An unexpected property was found in the WebExtension manifest.
- alwaysannoyed 8y agoFirefox ESR 52.5.0 This fails with error: Promise { <state>: "rejected", <reason>: TypeError } TypeError: this.XPIInternal is undefined[Learn More] However I've re-enabled all extensions by: Type about:config in a new window's address bar. Type 'signatures' in the search bar. You should see a line saying 'xpinstall.signatures.required'. Double click on it and 'true' should change to 'false' Restart Firefox.