MCPcopy
hub / github.com/darkreader/darkreader / cleanup

Function cleanup

src/inject/index.ts:32–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30const scriptId = generateUID();
31
32function cleanup() {
33 unloaded = true;
34 removeEventListener('pagehide', onPageHide);
35 removeEventListener('freeze', onFreeze);
36 removeEventListener('resume', onResume);
37 cleanDynamicThemeCache();
38 stopDarkThemeDetector();
39 stopColorSchemeChangeDetector();
40}
41
42function sendMessageForTesting(uuid: string) {
43 document.dispatchEvent(new CustomEvent('test-message', {detail: uuid}));

Callers 3

responseHandlerFunction · 0.70
sendMessageFunction · 0.70
onMessageFunction · 0.70

Calls 3

cleanDynamicThemeCacheFunction · 0.90
stopDarkThemeDetectorFunction · 0.90

Tested by

no test coverage detected