From 33e517c4a9b62a1829582b7dc105880228089d3d Mon Sep 17 00:00:00 2001 From: tophf Date: Mon, 14 Feb 2022 23:50:46 +0300 Subject: [PATCH] unregister matchMedia when orphanized --- content/apply.js | 1 + 1 file changed, 1 insertion(+) diff --git a/content/apply.js b/content/apply.js index 5dc1da24..ce2e86a7 100644 --- a/content/apply.js +++ b/content/apply.js @@ -264,6 +264,7 @@ // In Chrome content script is orphaned on an extension update/reload // so we need to detach event listeners window.removeEventListener(orphanEventId, orphanCheck, true); + mqDark.onchange = null; isOrphaned = true; setTimeout(styleInjector.clear, 1000); // avoiding FOUC tryCatch(msg.off, applyOnMessage);