Bug 1581117 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I guess it's pretty easy to fix anyway.

I tested the fix on Linux with:

```js
diff --git a/toolkit/modules/LightweightThemeConsumer.jsm b/toolkit/modules/LightweightThemeConsumer.jsm
index cf68e690257f..facbe4d85b50 100644
--- a/toolkit/modules/LightweightThemeConsumer.jsm
+++ b/toolkit/modules/LightweightThemeConsumer.jsm
@@ -185,10 +185,10 @@ function LightweightThemeConsumer(aDocument) {
   // We're responsible for notifying LightweightThemeManager when the OS is in
   // dark mode so it can activate the dark theme. We don't want this on Linux
   // as the default theme picks up the right colors from dark GTK themes.
-  if (AppConstants.platform != "linux") {
-    this.darkThemeMediaQuery = this._win.matchMedia("(-moz-system-dark-theme)");
+  // if (AppConstants.platform != "linux") {
+    this.darkThemeMediaQuery = this._win.matchMedia("(min-width: 1000px)");
     this.darkThemeMediaQuery.addListener(this);
-  }
+  // }
 
   const { LightweightThemeManager } = ChromeUtils.import(
     "resource://gre/modules/LightweightThemeManager.jsm"
@@ -216,7 +216,7 @@ LightweightThemeConsumer.prototype = {
   },
 
   handleEvent(aEvent) {
-    if (aEvent.media == "(-moz-system-dark-theme)") {
+    if (aEvent.media && aEvent.srcElement == this.darkThemeMediaQuery) {
       Services.obs.notifyObservers(this._lastData, "lightweight-theme-styling-update");
       return;
     }
```

And resizing the browser.
I guess it's pretty easy to fix anyway.

I tested the fix on Linux with:

```diff
diff --git a/toolkit/modules/LightweightThemeConsumer.jsm b/toolkit/modules/LightweightThemeConsumer.jsm
index cf68e690257f..facbe4d85b50 100644
--- a/toolkit/modules/LightweightThemeConsumer.jsm
+++ b/toolkit/modules/LightweightThemeConsumer.jsm
@@ -185,10 +185,10 @@ function LightweightThemeConsumer(aDocument) {
   // We're responsible for notifying LightweightThemeManager when the OS is in
   // dark mode so it can activate the dark theme. We don't want this on Linux
   // as the default theme picks up the right colors from dark GTK themes.
-  if (AppConstants.platform != "linux") {
-    this.darkThemeMediaQuery = this._win.matchMedia("(-moz-system-dark-theme)");
+  // if (AppConstants.platform != "linux") {
+    this.darkThemeMediaQuery = this._win.matchMedia("(min-width: 1000px)");
     this.darkThemeMediaQuery.addListener(this);
-  }
+  // }
 
   const { LightweightThemeManager } = ChromeUtils.import(
     "resource://gre/modules/LightweightThemeManager.jsm"
@@ -216,7 +216,7 @@ LightweightThemeConsumer.prototype = {
   },
 
   handleEvent(aEvent) {
-    if (aEvent.media == "(-moz-system-dark-theme)") {
+    if (aEvent.media && aEvent.srcElement == this.darkThemeMediaQuery) {
       Services.obs.notifyObservers(this._lastData, "lightweight-theme-styling-update");
       return;
     }
```

And resizing the browser.

Back to Bug 1581117 Comment 3