darkreader 4.9.89 → 4.9.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/darkreader.js +31 -58
- package/package.json +11 -10
package/darkreader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Dark Reader v4.9.
|
|
2
|
+
* Dark Reader v4.9.94
|
|
3
3
|
* https://darkreader.org/
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -355,20 +355,35 @@
|
|
|
355
355
|
darkSchemeTextColor: DEFAULT_COLORS.darkScheme.text,
|
|
356
356
|
lightSchemeBackgroundColor: DEFAULT_COLORS.lightScheme.background,
|
|
357
357
|
lightSchemeTextColor: DEFAULT_COLORS.lightScheme.text,
|
|
358
|
-
scrollbarColor:
|
|
358
|
+
scrollbarColor: "",
|
|
359
359
|
selectionColor: "auto",
|
|
360
360
|
styleSystemControls: !isCSSColorSchemePropSupported,
|
|
361
361
|
lightColorScheme: "Default",
|
|
362
362
|
darkColorScheme: "Default",
|
|
363
363
|
immediateModify: false
|
|
364
364
|
};
|
|
365
|
+
const filterModeSites = [
|
|
366
|
+
"*.officeapps.live.com",
|
|
367
|
+
"*.sharepoint.com",
|
|
368
|
+
"docs.google.com",
|
|
369
|
+
"onedrive.live.com"
|
|
370
|
+
];
|
|
365
371
|
({
|
|
366
372
|
schemeVersion: 0,
|
|
367
373
|
enabled: true,
|
|
368
374
|
fetchNews: true,
|
|
369
375
|
theme: DEFAULT_THEME,
|
|
370
376
|
presets: [],
|
|
371
|
-
customThemes:
|
|
377
|
+
customThemes: filterModeSites.map((url) => {
|
|
378
|
+
const engine = isChromium
|
|
379
|
+
? ThemeEngine.svgFilter
|
|
380
|
+
: ThemeEngine.cssFilter;
|
|
381
|
+
return {
|
|
382
|
+
url: [url],
|
|
383
|
+
theme: {...DEFAULT_THEME, engine},
|
|
384
|
+
builtIn: true
|
|
385
|
+
};
|
|
386
|
+
}),
|
|
372
387
|
enabledByDefault: true,
|
|
373
388
|
enabledFor: [],
|
|
374
389
|
disabledFor: [],
|
|
@@ -393,7 +408,7 @@
|
|
|
393
408
|
enableForPDF: true,
|
|
394
409
|
enableForProtectedPages: false,
|
|
395
410
|
enableContextMenus: false,
|
|
396
|
-
detectDarkTheme:
|
|
411
|
+
detectDarkTheme: true
|
|
397
412
|
});
|
|
398
413
|
|
|
399
414
|
function isArrayLike(items) {
|
|
@@ -2733,7 +2748,7 @@
|
|
|
2733
2748
|
lines.push(` color-scheme: dark !important;`);
|
|
2734
2749
|
lines.push("}");
|
|
2735
2750
|
lines.push("iframe {");
|
|
2736
|
-
lines.push(` color-scheme:
|
|
2751
|
+
lines.push(` color-scheme: dark !important;`);
|
|
2737
2752
|
lines.push("}");
|
|
2738
2753
|
}
|
|
2739
2754
|
const bgSelectors = joinSelectors(
|
|
@@ -2841,70 +2856,26 @@
|
|
|
2841
2856
|
return lines.join("\n");
|
|
2842
2857
|
}
|
|
2843
2858
|
function getModifiedScrollbarStyle(theme) {
|
|
2844
|
-
const lines = [];
|
|
2845
2859
|
let colorTrack;
|
|
2846
|
-
let colorIcons;
|
|
2847
2860
|
let colorThumb;
|
|
2848
|
-
let colorThumbHover;
|
|
2849
|
-
let colorThumbActive;
|
|
2850
|
-
let colorCorner;
|
|
2851
2861
|
if (theme.scrollbarColor === "auto") {
|
|
2852
2862
|
colorTrack = modifyBackgroundColor({r: 241, g: 241, b: 241}, theme);
|
|
2853
|
-
colorIcons = modifyForegroundColor({r: 96, g: 96, b: 96}, theme);
|
|
2854
2863
|
colorThumb = modifyBackgroundColor({r: 176, g: 176, b: 176}, theme);
|
|
2855
|
-
colorThumbHover = modifyBackgroundColor(
|
|
2856
|
-
{r: 144, g: 144, b: 144},
|
|
2857
|
-
theme
|
|
2858
|
-
);
|
|
2859
|
-
colorThumbActive = modifyBackgroundColor(
|
|
2860
|
-
{r: 96, g: 96, b: 96},
|
|
2861
|
-
theme
|
|
2862
|
-
);
|
|
2863
|
-
colorCorner = modifyBackgroundColor(
|
|
2864
|
-
{r: 255, g: 255, b: 255},
|
|
2865
|
-
theme
|
|
2866
|
-
);
|
|
2867
2864
|
} else {
|
|
2868
2865
|
const rgb = parseColorWithCache(theme.scrollbarColor);
|
|
2869
2866
|
const hsl = rgbToHSL(rgb);
|
|
2870
|
-
const isLight = hsl.l > 0.5;
|
|
2871
|
-
const lighten = (lighter) => ({
|
|
2872
|
-
...hsl,
|
|
2873
|
-
l: clamp(hsl.l + lighter, 0, 1)
|
|
2874
|
-
});
|
|
2875
2867
|
const darken = (darker) => ({
|
|
2876
2868
|
...hsl,
|
|
2877
2869
|
l: clamp(hsl.l - darker, 0, 1)
|
|
2878
2870
|
});
|
|
2879
2871
|
colorTrack = hslToString(darken(0.4));
|
|
2880
|
-
colorIcons = hslToString(isLight ? darken(0.4) : lighten(0.4));
|
|
2881
2872
|
colorThumb = hslToString(hsl);
|
|
2882
|
-
colorThumbHover = hslToString(lighten(0.1));
|
|
2883
|
-
colorThumbActive = hslToString(lighten(0.2));
|
|
2884
|
-
colorCorner = hslToString(darken(0.5));
|
|
2885
2873
|
}
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
lines.push(` background-color: ${colorThumb};`);
|
|
2892
|
-
lines.push("}");
|
|
2893
|
-
lines.push("::-webkit-scrollbar-thumb:hover {");
|
|
2894
|
-
lines.push(` background-color: ${colorThumbHover};`);
|
|
2895
|
-
lines.push("}");
|
|
2896
|
-
lines.push("::-webkit-scrollbar-thumb:active {");
|
|
2897
|
-
lines.push(` background-color: ${colorThumbActive};`);
|
|
2898
|
-
lines.push("}");
|
|
2899
|
-
lines.push("::-webkit-scrollbar-corner {");
|
|
2900
|
-
lines.push(` background-color: ${colorCorner};`);
|
|
2901
|
-
lines.push("}");
|
|
2902
|
-
if (isFirefox) {
|
|
2903
|
-
lines.push("* {");
|
|
2904
|
-
lines.push(` scrollbar-color: ${colorThumb} ${colorTrack};`);
|
|
2905
|
-
lines.push("}");
|
|
2906
|
-
}
|
|
2907
|
-
return lines.join("\n");
|
|
2874
|
+
return [
|
|
2875
|
+
`* {`,
|
|
2876
|
+
` scrollbar-color: ${colorThumb} ${colorTrack};`,
|
|
2877
|
+
`}`
|
|
2878
|
+
].join("\n");
|
|
2908
2879
|
}
|
|
2909
2880
|
function getModifiedFallbackStyle(theme, {strict}) {
|
|
2910
2881
|
const factory = defaultFallbackFactory;
|
|
@@ -6356,7 +6327,7 @@
|
|
|
6356
6327
|
function overrideProperty(cls, prop, overrides) {
|
|
6357
6328
|
const proto = cls.prototype;
|
|
6358
6329
|
const oldDescriptor = Object.getOwnPropertyDescriptor(proto, prop);
|
|
6359
|
-
const newDescriptor = {...oldDescriptor};
|
|
6330
|
+
const newDescriptor = oldDescriptor ? {...oldDescriptor} : {};
|
|
6360
6331
|
Object.keys(overrides).forEach((key) => {
|
|
6361
6332
|
const factory = overrides[key];
|
|
6362
6333
|
newDescriptor[key] = factory(oldDescriptor[key]);
|
|
@@ -6882,7 +6853,9 @@
|
|
|
6882
6853
|
document.head.appendChild(overrideStyle);
|
|
6883
6854
|
setupNodePositionWatcher(overrideStyle, "override");
|
|
6884
6855
|
const variableStyle = createOrUpdateStyle("darkreader--variables");
|
|
6885
|
-
const selectionColors =
|
|
6856
|
+
const selectionColors = theme?.selectionColor
|
|
6857
|
+
? getSelectionColor(theme)
|
|
6858
|
+
: null;
|
|
6886
6859
|
const neutralBackgroundColor = modifyBackgroundColor(
|
|
6887
6860
|
parseColorWithCache("#ffffff"),
|
|
6888
6861
|
theme
|
|
@@ -6895,8 +6868,8 @@
|
|
|
6895
6868
|
`:root {`,
|
|
6896
6869
|
` --darkreader-neutral-background: ${neutralBackgroundColor};`,
|
|
6897
6870
|
` --darkreader-neutral-text: ${neutralTextColor};`,
|
|
6898
|
-
` --darkreader-selection-background: ${selectionColors
|
|
6899
|
-
` --darkreader-selection-text: ${selectionColors
|
|
6871
|
+
` --darkreader-selection-background: ${selectionColors?.backgroundColorSelection ?? "initial"};`,
|
|
6872
|
+
` --darkreader-selection-text: ${selectionColors?.foregroundColorSelection ?? "initial"};`,
|
|
6900
6873
|
`}`
|
|
6901
6874
|
].join("\n");
|
|
6902
6875
|
document.head.insertBefore(variableStyle, inlineStyle.nextSibling);
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "darkreader",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.94",
|
|
4
4
|
"description": "Dark mode for every website",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"api": "node --max-old-space-size=3072 tasks/cli.js build --api",
|
|
7
7
|
"build": "node --max-old-space-size=3072 tasks/cli.js build --release",
|
|
8
8
|
"build:all": "node --max-old-space-size=3072 tasks/cli.js build --debug --release --api",
|
|
9
|
+
"build:firefox": "node --max-old-space-size=3072 tasks/cli.js build --release --firefox",
|
|
9
10
|
"build:plus": "node --max-old-space-size=3072 tasks/cli.js build --plus --release",
|
|
10
11
|
"code-style": "npm run lint",
|
|
11
12
|
"debug": "node --max-old-space-size=3072 tasks/cli.js build --debug",
|
|
@@ -65,23 +66,23 @@
|
|
|
65
66
|
"@rollup/plugin-node-resolve": "15.2.3",
|
|
66
67
|
"@rollup/plugin-replace": "5.0.7",
|
|
67
68
|
"@rollup/plugin-typescript": "11.1.6",
|
|
68
|
-
"@types/chrome": "0.0.
|
|
69
|
+
"@types/chrome": "0.0.270",
|
|
69
70
|
"@types/eslint": "8.56.10",
|
|
70
71
|
"@types/jasmine": "5.1.4",
|
|
71
72
|
"@types/jest": "29.5.12",
|
|
72
73
|
"@types/karma": "6.3.8",
|
|
73
74
|
"@types/karma-coverage": "2.0.3",
|
|
74
|
-
"@types/node": "22.
|
|
75
|
+
"@types/node": "22.5.4",
|
|
75
76
|
"@types/ws": "8.5.12",
|
|
76
77
|
"@typescript-eslint/eslint-plugin": "7.16.0",
|
|
77
78
|
"@typescript-eslint/parser": "7.16.0",
|
|
78
79
|
"chokidar": "3.6.0",
|
|
79
80
|
"eslint": "8.57.0",
|
|
80
81
|
"eslint-plugin-compat": "5.0.0",
|
|
81
|
-
"eslint-plugin-import": "2.
|
|
82
|
+
"eslint-plugin-import": "2.30.0",
|
|
82
83
|
"eslint-plugin-local": "4.2.2",
|
|
83
84
|
"globby": "14.0.2",
|
|
84
|
-
"jasmine-core": "5.
|
|
85
|
+
"jasmine-core": "5.3.0",
|
|
85
86
|
"jest": "29.7.0",
|
|
86
87
|
"jest-extended": "4.0.2",
|
|
87
88
|
"karma": "6.4.4",
|
|
@@ -94,12 +95,12 @@
|
|
|
94
95
|
"karma-spec-reporter": "0.0.36",
|
|
95
96
|
"less": "4.2.0",
|
|
96
97
|
"prettier": "3.3.3",
|
|
97
|
-
"puppeteer-core": "23.0
|
|
98
|
-
"rollup": "4.
|
|
98
|
+
"puppeteer-core": "23.3.0",
|
|
99
|
+
"rollup": "4.21.2",
|
|
99
100
|
"rollup-plugin-istanbul": "5.0.0",
|
|
100
|
-
"ts-jest": "29.2.
|
|
101
|
-
"tslib": "2.
|
|
102
|
-
"typescript": "5.
|
|
101
|
+
"ts-jest": "29.2.5",
|
|
102
|
+
"tslib": "2.7.0",
|
|
103
|
+
"typescript": "5.6.2",
|
|
103
104
|
"web-ext": "8.2.0",
|
|
104
105
|
"ws": "8.18.0",
|
|
105
106
|
"yazl": "2.5.1"
|