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

Function containsCSSImport

src/inject/dynamic-theme/style-manager.ts:164–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

162 const observerOptions: MutationObserverInit = {attributes: true, childList: true, subtree: true, characterData: true};
163
164 function containsCSSImport() {
165 if (!(element instanceof HTMLStyleElement)) {
166 return false;
167 }
168 const cssText = removeCSSComments(element.textContent ?? '').trim();
169 return cssText.match(cssImportRegex);
170 }
171
172 // It loops trough the cssRules and check for CSSImportRule and their `href`.
173 // If the `href` isn't local and doesn't start with the same-origin.

Callers 3

manageStyleFunction · 0.85
getRulesSyncFunction · 0.85
getRulesAsyncFunction · 0.85

Calls 1

removeCSSCommentsFunction · 0.90

Tested by

no test coverage detected