unregister matchMedia when orphanized

This commit is contained in:
tophf 2022-02-14 23:50:46 +03:00
parent 32df8cb767
commit 33e517c4a9

View File

@ -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);