mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-06 09:56:36 +00:00
fix: add condition to listen for color scheme changes only in main browser window
This commit is contained in:
@@ -36,7 +36,9 @@ var ZenThemeModifier = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
listenForEvents() {
|
listenForEvents() {
|
||||||
|
if (this._inMainBrowserWindow) {
|
||||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', this._onPrefersColorSchemeChange.bind(this));
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', this._onPrefersColorSchemeChange.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
var handleEvent = this.handleEvent.bind(this);
|
var handleEvent = this.handleEvent.bind(this);
|
||||||
// Listen for changes in the accent color and border radius
|
// Listen for changes in the accent color and border radius
|
||||||
|
Reference in New Issue
Block a user