MCPcopy Index your code
hub / github.com/darkreader/darkreader / hasSomeStyle

Function hasSomeStyle

src/inject/detector.ts:113–126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

111}
112
113function hasSomeStyle() {
114 if (document.querySelector(COLOR_SCHEME_META_SELECTOR) != null) {
115 return true;
116 }
117 if (document.documentElement.style.backgroundColor || (document.body && document.body.style.backgroundColor)) {
118 return true;
119 }
120 for (const style of document.styleSheets) {
121 if (style && style.ownerNode && !((style.ownerNode as HTMLElement).classList && (style.ownerNode as HTMLElement).classList.contains('darkreader'))) {
122 return true;
123 }
124 }
125 return false;
126}
127
128let observer: MutationObserver | null;
129let readyStateListener: (() => void) | null;

Callers 1

canCheckForStyleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…