From bc1e30b743968edad31ba54e4fc95f93ee6d39ff Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Fri, 13 Dec 2019 10:33:41 +0000 Subject: More dark mode issues --- js/background.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'js/background.js') diff --git a/js/background.js b/js/background.js index fbf2572..4bdba26 100644 --- a/js/background.js +++ b/js/background.js @@ -290,6 +290,8 @@ chrome.runtime.onMessage.addListener( }); } }); + } else if (request.type == 'update-icon') { + updateIcon(); } else if (request.type == 'toggle-sync') { // Notes on Toggle Sync feature here https://github.com/einaregilsson/Redirector/issues/86#issuecomment-389943854 // This provides for feature request - issue 86 @@ -463,4 +465,8 @@ function handleStartup(){ }); updateIcon(); //To set dark/light icon... + + //This doesn't work yet in Chrome, but we'll put it here anyway, in case it starts working... + let darkModeMql = window.matchMedia('(prefers-color-scheme: dark)'); + darkModeMql.onchange = updateIcon; } \ No newline at end of file -- cgit v1.2.3