Don't disable lightweight themes in PB mode.

This resolves #640
This commit is contained in:
wolfbeast 2018-07-17 10:24:21 +02:00 • committed by Roy Tam
commit 9a207124fc

View file

@ -22,10 +22,12 @@ this.LightweightThemeConsumer =
this._win = aDocument.defaultView; this._win = aDocument.defaultView;
this._footerId = aDocument.documentElement.getAttribute("lightweightthemesfooter"); this._footerId = aDocument.documentElement.getAttribute("lightweightthemesfooter");
/* XXX: If we want to disable LWTs for PB mode, this would be needed.
* Perhaps make this pref-controlled in the future if people want it?
if (PrivateBrowsingUtils.isWindowPrivate(this._win) && if (PrivateBrowsingUtils.isWindowPrivate(this._win) &&
!PrivateBrowsingUtils.permanentPrivateBrowsing) { !PrivateBrowsingUtils.permanentPrivateBrowsing) {
return; return;
} } */
let screen = this._win.screen; let screen = this._win.screen;
this._lastScreenWidth = screen.width; this._lastScreenWidth = screen.width;
@ -87,12 +89,16 @@ LightweightThemeConsumer.prototype = {
}, },
destroy: function () { destroy: function () {
/* XXX: If we want to disable LWTs for PB mode, this would be needed.
if (!PrivateBrowsingUtils.isWindowPrivate(this._win) || if (!PrivateBrowsingUtils.isWindowPrivate(this._win) ||
PrivateBrowsingUtils.permanentPrivateBrowsing) { PrivateBrowsingUtils.permanentPrivateBrowsing) {
Services.obs.removeObserver(this, "lightweight-theme-styling-update"); Services.obs.removeObserver(this, "lightweight-theme-styling-update");
this._win.removeEventListener("resize", this); this._win.removeEventListener("resize", this);
} } */
Services.obs.removeObserver(this, "lightweight-theme-styling-update");
this._win.removeEventListener("resize", this);
this._win = this._doc = null; this._win = this._doc = null;
}, },