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

Function enable

src/api/index.ts:21–31  ·  view source on GitHub ↗
(themeOptions: Partial<Theme> | null = {}, fixes: DynamicThemeFix | null = null)

Source from the content-addressed store, hash-verified

19})();
20
21export function enable(themeOptions: Partial<Theme> | null = {}, fixes: DynamicThemeFix | null = null): void {
22 const theme = {...DEFAULT_THEME, ...themeOptions};
23
24 if (theme.engine !== ThemeEngine.dynamicTheme) {
25 throw new Error('Theme engine is not supported.');
26 }
27 // TODO: replace with createOrUpdateDynamicTheme() and make fixes signature
28 // DynamicThemeFix | DynamicThemeFix[]
29 createOrUpdateDynamicThemeInternal(theme, fixes, isIFrame);
30 isDarkReaderEnabled = true;
31}
32
33export function isEnabled(): boolean {
34 return isDarkReaderEnabled;

Callers 1

handleColorSchemeFunction · 0.85

Calls 1

Tested by

no test coverage detected