forked from darkreader/darkreader
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdefaults.ts
More file actions
104 lines (98 loc) · 2.95 KB
/
Copy pathdefaults.ts
File metadata and controls
104 lines (98 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import type {ParsedColorSchemeConfig} from './utils/colorscheme-parser';
import type {Theme, UserSettings} from './definitions';
import {ThemeEngine} from './generators/theme-engines';
import {isMacOS, isWindows, isCSSColorSchemePropSupported, isEdge, isMobile, isChromium} from './utils/platform';
import {AutomationMode} from './utils/automation';
declare const __CHROMIUM_MV3__: boolean;
export const DEFAULT_COLORS = {
darkScheme: {
background: '#181a1b',
text: '#e8e6e3',
},
lightScheme: {
background: '#dcdad7',
text: '#181a1b',
},
};
export const DEFAULT_THEME: Theme = {
mode: 1,
brightness: 100,
contrast: 100,
grayscale: 0,
sepia: 0,
useFont: false,
fontFamily: isMacOS ? 'Helvetica Neue' : isWindows ? 'Segoe UI' : 'Open Sans',
textStroke: 0,
engine: ThemeEngine.dynamicTheme,
stylesheet: '',
darkSchemeBackgroundColor: DEFAULT_COLORS.darkScheme.background,
darkSchemeTextColor: DEFAULT_COLORS.darkScheme.text,
lightSchemeBackgroundColor: DEFAULT_COLORS.lightScheme.background,
lightSchemeTextColor: DEFAULT_COLORS.lightScheme.text,
scrollbarColor: '',
selectionColor: 'auto',
styleSystemControls: __CHROMIUM_MV3__ ? false : !isCSSColorSchemePropSupported,
lightColorScheme: 'Default',
darkColorScheme: 'Default',
immediateModify: false,
};
export const DEFAULT_COLORSCHEME: ParsedColorSchemeConfig = {
light: {
Default: {
backgroundColor: DEFAULT_COLORS.lightScheme.background,
textColor: DEFAULT_COLORS.lightScheme.text,
},
},
dark: {
Default: {
backgroundColor: DEFAULT_COLORS.darkScheme.background,
textColor: DEFAULT_COLORS.darkScheme.text,
},
},
};
const filterModeSites = [
'*.officeapps.live.com',
'*.sharepoint.com',
'docs.google.com',
'onedrive.live.com',
];
export const DEFAULT_SETTINGS: UserSettings = {
schemeVersion: 0,
enabled: true,
fetchNews: true,
theme: DEFAULT_THEME,
presets: [],
customThemes: filterModeSites.map((url) => {
const engine: ThemeEngine = isChromium ? ThemeEngine.svgFilter : ThemeEngine.cssFilter;
return {
url: [url],
theme: {...DEFAULT_THEME, engine},
builtIn: true,
};
}),
enabledByDefault: true,
enabledFor: [],
disabledFor: [],
changeBrowserTheme: false,
syncSettings: true,
syncSitesFixes: false,
automation: {
enabled: isEdge && isMobile ? true : false,
mode: isEdge && isMobile ? AutomationMode.SYSTEM : AutomationMode.NONE,
behavior: 'OnOff',
},
time: {
activation: '18:00',
deactivation: '9:00',
},
location: {
latitude: null,
longitude: null,
},
previewNewDesign: false,
previewNewestDesign: false,
enableForPDF: true,
enableForProtectedPages: false,
enableContextMenus: false,
detectDarkTheme: true,
};