Index: lib/elemHide.js |
=================================================================== |
--- a/lib/elemHide.js |
+++ b/lib/elemHide.js |
@@ -78,17 +78,17 @@ let ElemHide = exports.ElemHide = |
/** |
* Called on module startup. |
*/ |
init: function() |
{ |
Prefs.addListener(function(name) |
{ |
- if (name == "enabled") |
+ if (name == "enabled" || name == "element_hiding_enabled") |
ElemHide.apply(); |
}); |
onShutdown.add(function() |
{ |
ElemHide.unapply(); |
}); |
let styleFile = IO.resolveFilePath(Prefs.data_directory); |
@@ -207,32 +207,34 @@ let ElemHide = exports.ElemHide = |
apply: function() |
{ |
if (this._applying) |
{ |
this._needsApply = true; |
return; |
} |
- if (!ElemHide.isDirty || !Prefs.enabled) |
+ let enabled = Prefs.enabled && Prefs.element_hiding_enabled; |
+ |
+ if (!ElemHide.isDirty || !enabled) |
{ |
// Nothing changed, looks like we merely got enabled/disabled |
- if (Prefs.enabled && !ElemHide.applied) |
+ if (enabled && !ElemHide.applied) |
{ |
try |
{ |
Utils.styleService.loadAndRegisterSheet(styleURL, Ci.nsIStyleSheetService.USER_SHEET); |
ElemHide.applied = true; |
} |
catch (e) |
{ |
Cu.reportError(e); |
} |
} |
- else if (!Prefs.enabled && ElemHide.applied) |
+ else if (!enabled && ElemHide.applied) |
{ |
ElemHide.unapply(); |
} |
return; |
} |
IO.writeToFile(styleURL.file, this._generateCSSContent(), function(e) |