Advertisement
Guest User

Untitled

a guest
May 4th, 2019
12,647
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None
  1. // Re-enable *all* extensions
  2.  
  3. async function set_addons_as_signed() {
  4. Components.utils.import("resource://gre/modules/addons/XPIDatabase.jsm");
  5. Components.utils.import("resource://gre/modules/AddonManager.jsm");
  6. let addons = await XPIDatabase.getAddonList(a => true);
  7.  
  8. for (let addon of addons) {
  9. // The add-on might have vanished, we'll catch that on the next startup
  10. if (!addon._sourceBundle.exists())
  11. continue;
  12.  
  13. if( addon.signedState != AddonManager.SIGNEDSTATE_UNKNOWN )
  14. continue;
  15.  
  16. addon.signedState = AddonManager.SIGNEDSTATE_NOT_REQUIRED;
  17. AddonManagerPrivate.callAddonListeners("onPropertyChanged",
  18. addon.wrapper,
  19. ["signedState"]);
  20.  
  21. await XPIDatabase.updateAddonDisabledState(addon);
  22.  
  23. }
  24. XPIDatabase.saveChanges();
  25. }
  26.  
  27. set_addons_as_signed();
Advertisement
RAW Paste Data Copied
Advertisement