Skip to content
Permalink
Browse files

Toggle hidden addons in Firefox 61+

  • Loading branch information...
Infocatcher committed May 18, 2018
1 parent 113a574 commit 3de4fb76373c0cc1c7c5cc2d50f5de2a1031b9f8
Showing with 7 additions and 2 deletions.
  1. +7 −2 Toggle_Restartless_Add-ons/toggleRestartlessAddons.js
@@ -185,8 +185,13 @@ function setNewDisabled(addon) {
if(addon.hidden) {
_log("Let's try set addon.userDisabled using raw hack");
let g = Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm", {});
// See "set userDisabled(val)"
if("eval" in g) {
if("XPIDatabase" in g && "updateAddonDisabledState" in g.XPIDatabase) { // Firefox 61+
let rawAddon = g.XPIDatabase.syncGetAddon(function(rawAddon) {
return rawAddon.id == addon.id;
});
g.XPIDatabase.updateAddonDisabledState(rawAddon, newDis);
}
else if("eval" in g) { // See "set userDisabled(val)"
let addonFor = g.eval("addonFor");
let rawAddon = addonFor(addon);
//rawAddon.userDisabled = newDis;

0 comments on commit 3de4fb7

Please sign in to comment.
You can’t perform that action at this time.