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

Function getRulesOrError

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

Source from the content-addressed store, hash-verified

454 }
455
456 function getRulesOrError(): [CSSRuleList | null, Error | null] {
457 try {
458 if (element.sheet == null) {
459 return [null, null];
460 }
461 return [element.sheet.cssRules, null];
462 } catch (err: any) {
463 return [null, err];
464 }
465 }
466
467 // NOTE: In Firefox, when link is loading,
468 // `sheet` property is not null,

Callers 2

getRulesAsyncFunction · 0.85
safeGetSheetRulesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected