()
| 129 | let readyStateListener: (() => void) | null; |
| 130 | |
| 131 | function canCheckForStyle() { |
| 132 | if (!( |
| 133 | document.body && |
| 134 | document.body.scrollHeight > 0 && |
| 135 | document.body.clientHeight > 0 && |
| 136 | document.body.childElementCount > 0 && |
| 137 | hasSomeStyle() |
| 138 | )) { |
| 139 | return false; |
| 140 | } |
| 141 | for (const child of document.body.children) { |
| 142 | if (child.tagName !== 'SCRIPT' && child.tagName !== 'STYLE' && child.tagName !== 'LINK') { |
| 143 | return true; |
| 144 | } |
| 145 | } |
| 146 | return false; |
| 147 | } |
| 148 | |
| 149 | export function runDarkThemeDetector(callback: (hasDarkTheme: boolean) => void, hints: DetectorHint[]): void { |
| 150 | stopDarkThemeDetector(); |
no test coverage detected