unregister matchMedia when orphanized
This commit is contained in:
parent
32df8cb767
commit
33e517c4a9
|
@ -264,6 +264,7 @@
|
||||||
// In Chrome content script is orphaned on an extension update/reload
|
// In Chrome content script is orphaned on an extension update/reload
|
||||||
// so we need to detach event listeners
|
// so we need to detach event listeners
|
||||||
window.removeEventListener(orphanEventId, orphanCheck, true);
|
window.removeEventListener(orphanEventId, orphanCheck, true);
|
||||||
|
mqDark.onchange = null;
|
||||||
isOrphaned = true;
|
isOrphaned = true;
|
||||||
setTimeout(styleInjector.clear, 1000); // avoiding FOUC
|
setTimeout(styleInjector.clear, 1000); // avoiding FOUC
|
||||||
tryCatch(msg.off, applyOnMessage);
|
tryCatch(msg.off, applyOnMessage);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user