darkreader 4.9.66 → 4.9.69
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/README.md +33 -6
- package/darkreader.js +51 -39
- package/package.json +25 -25
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ You can build Dark Reader with alternative runtime called [Deno](https://deno.la
|
|
|
41
41
|
|
|
42
42
|
Please note that if you encounter error `Too many open files (os error 24)`, then you should use the newer version of Deno (preferably built from source or canary).
|
|
43
43
|
|
|
44
|
-
### Bundling with official Firefox store signatures (
|
|
44
|
+
### Bundling with official Firefox store signatures (experimental)
|
|
45
45
|
|
|
46
46
|
Prior to publication, extension stores provide digital signatures for extensions. These digital signatures certify the integrity of the archive (that extension bundle did not get corrupted or bit-rotted) and that extension store preformed very basic extension validation.
|
|
47
47
|
|
|
@@ -122,15 +122,42 @@ Automatically syncing the site fixes to every Dark Reader user was disabled beca
|
|
|
122
122
|
However, this can be enabled using the following steps:
|
|
123
123
|
|
|
124
124
|
- Click on the Dark Reader icon.
|
|
125
|
-
- Click on the Dev tools button (in the bottom-right corner).
|
|
126
|
-
- Click on the Preview new design button.
|
|
127
|
-
- Enable the `Synchronize site fixes` setting under `Settings -> Manage
|
|
125
|
+
- Click on the `Dev tools` button (in the bottom-right corner).
|
|
126
|
+
- Click on the `Preview new design` button.
|
|
127
|
+
- Enable the `Synchronize site fixes` setting under `Settings` -> `Manage settings`.
|
|
128
128
|
|
|
129
129
|
To force a synchronization of the sites fixes (when the corresponding setting is enabled), perform the following steps:
|
|
130
130
|
|
|
131
131
|
- Click on the Dark Reader icon.
|
|
132
|
-
- Click on the Dev tools button (in the bottom-right corner).
|
|
133
|
-
- Click on the Reset button. This will remove any custom site fixes you may have.
|
|
132
|
+
- Click on the `Dev tools` button (in the bottom-right corner).
|
|
133
|
+
- Click on the `Reset` button. This will remove any custom site fixes you may have.
|
|
134
|
+
|
|
135
|
+
## Enable Dark Reader for restricted websites on Firefox
|
|
136
|
+
|
|
137
|
+
By default, Dark Reader does not work on some websites due to **security restrictions** enforced by Mozilla.
|
|
138
|
+
|
|
139
|
+
The following instructions will guide you on how to bypass those restrictions.
|
|
140
|
+
|
|
141
|
+
**Proceed with caution. This exposes you to a security risk if you do not know what you are doing.**
|
|
142
|
+
|
|
143
|
+
**These settings will apply to all extensions, and not just Dark Reader.**
|
|
144
|
+
|
|
145
|
+
Step 1: change Dark Reader's settings.
|
|
146
|
+
|
|
147
|
+
- Click on the Dark Reader icon.
|
|
148
|
+
- Click on the `Dev tools` button (in the bottom-right corner).
|
|
149
|
+
- Click on the `Preview new design button`.
|
|
150
|
+
- Enable the `Enable on restricted pages` setting under `Settings` -> `Site list`.
|
|
151
|
+
|
|
152
|
+
Step 2: change Firefox's settings.
|
|
153
|
+
|
|
154
|
+
- Type `about:config` in the address bar and press Enter.
|
|
155
|
+
A warning page may appear. Click `Accept the Risk and Continue` to go to the `about:config` page.
|
|
156
|
+
- Search for and set `extensions.webextensions.restrictedDomains` to an empty value.
|
|
157
|
+
- Create `extensions.webextensions.addons-restricted-domains@mozilla.com.disabled` with `boolean` as type and set its value to `true`.
|
|
158
|
+
- Set `extensions.quarantinedDomains.enabled` to `false`.
|
|
159
|
+
- Create `privacy.resistFingerprinting.block_mozAddonManager` with `boolean` as type and set its value to `true`.
|
|
160
|
+
- Restart Firefox.
|
|
134
161
|
|
|
135
162
|
<h2 align="center">Contributors</h2>
|
|
136
163
|
<br/>
|
package/darkreader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Dark Reader v4.9.
|
|
2
|
+
* Dark Reader v4.9.69
|
|
3
3
|
* https://darkreader.org/
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
typeof exports === "object" && typeof module !== "undefined"
|
|
8
8
|
? factory(exports)
|
|
9
9
|
: typeof define === "function" && define.amd
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
? define(["exports"], factory)
|
|
11
|
+
: ((global =
|
|
12
|
+
typeof globalThis !== "undefined"
|
|
13
|
+
? globalThis
|
|
14
|
+
: global || self),
|
|
15
|
+
factory((global.DarkReader = {})));
|
|
14
16
|
})(this, function (exports) {
|
|
15
17
|
"use strict";
|
|
16
18
|
|
|
@@ -117,9 +119,9 @@
|
|
|
117
119
|
op[0] & 2
|
|
118
120
|
? y["return"]
|
|
119
121
|
: op[0]
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
? y["throw"] ||
|
|
123
|
+
((t = y["return"]) && t.call(y), 0)
|
|
124
|
+
: y.next) &&
|
|
123
125
|
!(t = t.call(y, op[1])).done)
|
|
124
126
|
)
|
|
125
127
|
return t;
|
|
@@ -678,8 +680,8 @@
|
|
|
678
680
|
fontFamily: isMacOS
|
|
679
681
|
? "Helvetica Neue"
|
|
680
682
|
: isWindows
|
|
681
|
-
|
|
682
|
-
|
|
683
|
+
? "Segoe UI"
|
|
684
|
+
: "Open Sans",
|
|
683
685
|
textStroke: 0,
|
|
684
686
|
engine: ThemeEngine.dynamicTheme,
|
|
685
687
|
stylesheet: "",
|
|
@@ -695,14 +697,15 @@
|
|
|
695
697
|
immediateModify: false
|
|
696
698
|
};
|
|
697
699
|
({
|
|
700
|
+
schemeVersion: 0,
|
|
698
701
|
enabled: true,
|
|
699
702
|
fetchNews: true,
|
|
700
703
|
theme: DEFAULT_THEME,
|
|
701
704
|
presets: [],
|
|
702
705
|
customThemes: [],
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
+
enabledByDefault: true,
|
|
707
|
+
enabledFor: [],
|
|
708
|
+
disabledFor: [],
|
|
706
709
|
changeBrowserTheme: false,
|
|
707
710
|
syncSettings: true,
|
|
708
711
|
syncSitesFixes: false,
|
|
@@ -1553,14 +1556,14 @@
|
|
|
1553
1556
|
(h < 60
|
|
1554
1557
|
? [c, x, 0]
|
|
1555
1558
|
: h < 120
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1559
|
+
? [x, c, 0]
|
|
1560
|
+
: h < 180
|
|
1561
|
+
? [0, c, x]
|
|
1562
|
+
: h < 240
|
|
1563
|
+
? [0, x, c]
|
|
1564
|
+
: h < 300
|
|
1565
|
+
? [x, 0, c]
|
|
1566
|
+
: [c, 0, x]
|
|
1564
1567
|
).map(function (n) {
|
|
1565
1568
|
return Math.round((n + m) * 255);
|
|
1566
1569
|
}),
|
|
@@ -1591,8 +1594,8 @@
|
|
|
1591
1594
|
(max === r
|
|
1592
1595
|
? ((g - b) / c) % 6
|
|
1593
1596
|
: max === g
|
|
1594
|
-
|
|
1595
|
-
|
|
1597
|
+
? (b - r) / c + 2
|
|
1598
|
+
: (r - g) / c + 4) * 60;
|
|
1596
1599
|
if (h < 0) {
|
|
1597
1600
|
h += 360;
|
|
1598
1601
|
}
|
|
@@ -3268,6 +3271,11 @@
|
|
|
3268
3271
|
return lines.join("\n");
|
|
3269
3272
|
}
|
|
3270
3273
|
function getModifiedFallbackStyle(filter, _a) {
|
|
3274
|
+
var strict = _a.strict;
|
|
3275
|
+
var factory = defaultFallbackFactory;
|
|
3276
|
+
return factory(filter, {strict: strict});
|
|
3277
|
+
}
|
|
3278
|
+
function defaultFallbackFactory(filter, _a) {
|
|
3271
3279
|
var strict = _a.strict;
|
|
3272
3280
|
var lines = [];
|
|
3273
3281
|
var isMicrosoft = ["microsoft.com", "docs.microsoft.com"].includes(
|
|
@@ -3844,14 +3852,14 @@
|
|
|
3844
3852
|
VariablesStore.prototype.addRulesForMatching = function (rules) {
|
|
3845
3853
|
this.rulesQueue.push(rules);
|
|
3846
3854
|
};
|
|
3847
|
-
VariablesStore.prototype.
|
|
3855
|
+
VariablesStore.prototype.matchVariablesAndDependents = function () {
|
|
3848
3856
|
var _this = this;
|
|
3849
3857
|
this.changedTypeVars.clear();
|
|
3850
3858
|
this.initialVarTypes = new Map(this.varTypes);
|
|
3851
3859
|
this.collectRootVariables();
|
|
3852
3860
|
this.collectVariablesAndVarDep(this.rulesQueue);
|
|
3853
3861
|
this.rulesQueue.splice(0);
|
|
3854
|
-
this.
|
|
3862
|
+
this.collectRootVarDependents();
|
|
3855
3863
|
this.varRefs.forEach(function (refs, v) {
|
|
3856
3864
|
refs.forEach(function (r) {
|
|
3857
3865
|
if (_this.varTypes.has(v)) {
|
|
@@ -3889,7 +3897,7 @@
|
|
|
3889
3897
|
);
|
|
3890
3898
|
}) != null;
|
|
3891
3899
|
if (hasColor) {
|
|
3892
|
-
_this.
|
|
3900
|
+
_this.iterateVarRefs(v, function (ref) {
|
|
3893
3901
|
_this.resolveVariableType(ref, VAR_TYPE_BGCOLOR);
|
|
3894
3902
|
});
|
|
3895
3903
|
} else if (
|
|
@@ -4054,8 +4062,8 @@
|
|
|
4054
4062
|
var modifier = isBg_1
|
|
4055
4063
|
? tryModifyBgColor
|
|
4056
4064
|
: isText_1
|
|
4057
|
-
|
|
4058
|
-
|
|
4065
|
+
? tryModifyTextColor
|
|
4066
|
+
: tryModifyBorderColor;
|
|
4059
4067
|
return modifier(value, theme);
|
|
4060
4068
|
};
|
|
4061
4069
|
}
|
|
@@ -4252,7 +4260,7 @@
|
|
|
4252
4260
|
this.unknownColorVars.delete(varName);
|
|
4253
4261
|
this.unknownBgVars.delete(varName);
|
|
4254
4262
|
};
|
|
4255
|
-
VariablesStore.prototype.
|
|
4263
|
+
VariablesStore.prototype.collectRootVarDependents = function () {
|
|
4256
4264
|
var _this = this;
|
|
4257
4265
|
iterateCSSDeclarations(
|
|
4258
4266
|
document.documentElement.style,
|
|
@@ -4311,7 +4319,7 @@
|
|
|
4311
4319
|
)
|
|
4312
4320
|
);
|
|
4313
4321
|
}) != null;
|
|
4314
|
-
_this.
|
|
4322
|
+
_this.iterateVarRefs(v, function (ref) {
|
|
4315
4323
|
if (isBgColor) {
|
|
4316
4324
|
_this.resolveVariableType(ref, VAR_TYPE_BGCOLOR);
|
|
4317
4325
|
} else {
|
|
@@ -4375,7 +4383,7 @@
|
|
|
4375
4383
|
}
|
|
4376
4384
|
return null;
|
|
4377
4385
|
};
|
|
4378
|
-
VariablesStore.prototype.
|
|
4386
|
+
VariablesStore.prototype.iterateVarRefs = function (varName, iterator) {
|
|
4379
4387
|
this.findVarRef(varName, function (ref) {
|
|
4380
4388
|
iterator(ref);
|
|
4381
4389
|
return false;
|
|
@@ -5660,10 +5668,14 @@
|
|
|
5660
5668
|
characterData: true
|
|
5661
5669
|
};
|
|
5662
5670
|
function containsCSSImport() {
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5671
|
+
var _a;
|
|
5672
|
+
if (!(element instanceof HTMLStyleElement)) {
|
|
5673
|
+
return false;
|
|
5674
|
+
}
|
|
5675
|
+
var cssText = removeCSSComments(
|
|
5676
|
+
(_a = element.textContent) !== null && _a !== void 0 ? _a : ""
|
|
5677
|
+
).trim();
|
|
5678
|
+
return cssText.match(cssImportRegex);
|
|
5667
5679
|
}
|
|
5668
5680
|
function hasImports(cssRules, checkCrossOrigin) {
|
|
5669
5681
|
var result = false;
|
|
@@ -7366,7 +7378,7 @@
|
|
|
7366
7378
|
.forEach(function (detail) {
|
|
7367
7379
|
variablesStore.addRulesForMatching(detail.rules);
|
|
7368
7380
|
});
|
|
7369
|
-
variablesStore.
|
|
7381
|
+
variablesStore.matchVariablesAndDependents();
|
|
7370
7382
|
variablesStore.setOnRootVariableChange(function () {
|
|
7371
7383
|
var rootVarsStyle = createOrUpdateStyle("darkreader--root-vars");
|
|
7372
7384
|
variablesStore.putRootVars(rootVarsStyle, filter);
|
|
@@ -7444,7 +7456,7 @@
|
|
|
7444
7456
|
return;
|
|
7445
7457
|
}
|
|
7446
7458
|
variablesStore.addRulesForMatching(details.rules);
|
|
7447
|
-
variablesStore.
|
|
7459
|
+
variablesStore.matchVariablesAndDependents();
|
|
7448
7460
|
manager.render(filter, ignoredImageAnalysisSelectors);
|
|
7449
7461
|
}
|
|
7450
7462
|
var manager = manageStyle(element, {
|
|
@@ -7539,7 +7551,7 @@
|
|
|
7539
7551
|
.forEach(function (detail) {
|
|
7540
7552
|
variablesStore.addRulesForMatching(detail.rules);
|
|
7541
7553
|
});
|
|
7542
|
-
variablesStore.
|
|
7554
|
+
variablesStore.matchVariablesAndDependents();
|
|
7543
7555
|
newManagers.forEach(function (manager) {
|
|
7544
7556
|
return manager.render(
|
|
7545
7557
|
filter,
|
|
@@ -7569,7 +7581,7 @@
|
|
|
7569
7581
|
if (element === document.documentElement) {
|
|
7570
7582
|
var styleAttr = element.getAttribute("style") || "";
|
|
7571
7583
|
if (styleAttr.includes("--")) {
|
|
7572
|
-
variablesStore.
|
|
7584
|
+
variablesStore.matchVariablesAndDependents();
|
|
7573
7585
|
var rootVarsStyle = createOrUpdateStyle(
|
|
7574
7586
|
"darkreader--root-vars"
|
|
7575
7587
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "darkreader",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.69",
|
|
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",
|
|
@@ -57,31 +57,31 @@
|
|
|
57
57
|
"url": "https://opencollective.com/darkreader/donate"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@rollup/plugin-node-resolve": "15.2.
|
|
61
|
-
"@rollup/plugin-replace": "5.0.
|
|
62
|
-
"@rollup/plugin-typescript": "11.1.
|
|
63
|
-
"@rollup/pluginutils": "5.0.
|
|
64
|
-
"@types/chrome": "0.0.
|
|
65
|
-
"@types/eslint": "8.44.
|
|
66
|
-
"@types/jasmine": "
|
|
67
|
-
"@types/jest": "29.5.
|
|
68
|
-
"@types/karma": "6.3.
|
|
69
|
-
"@types/karma-coverage": "2.0.
|
|
70
|
-
"@types/node": "20.
|
|
71
|
-
"@types/offscreencanvas": "2019.7.
|
|
72
|
-
"@types/ws": "8.5.
|
|
73
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
74
|
-
"@typescript-eslint/parser": "6.
|
|
60
|
+
"@rollup/plugin-node-resolve": "15.2.3",
|
|
61
|
+
"@rollup/plugin-replace": "5.0.5",
|
|
62
|
+
"@rollup/plugin-typescript": "11.1.5",
|
|
63
|
+
"@rollup/pluginutils": "5.0.5",
|
|
64
|
+
"@types/chrome": "0.0.251",
|
|
65
|
+
"@types/eslint": "8.44.7",
|
|
66
|
+
"@types/jasmine": "5.1.2",
|
|
67
|
+
"@types/jest": "29.5.8",
|
|
68
|
+
"@types/karma": "6.3.7",
|
|
69
|
+
"@types/karma-coverage": "2.0.3",
|
|
70
|
+
"@types/node": "20.9.1",
|
|
71
|
+
"@types/offscreencanvas": "2019.7.3",
|
|
72
|
+
"@types/ws": "8.5.9",
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "6.11.0",
|
|
74
|
+
"@typescript-eslint/parser": "6.11.0",
|
|
75
75
|
"chokidar": "3.5.3",
|
|
76
|
-
"eslint": "8.
|
|
76
|
+
"eslint": "8.54.0",
|
|
77
77
|
"eslint-plugin-compat": "4.2.0",
|
|
78
|
-
"eslint-plugin-import": "2.
|
|
78
|
+
"eslint-plugin-import": "2.29.0",
|
|
79
79
|
"eslint-plugin-local": "1.0.0",
|
|
80
80
|
"get-stream": "7.0.1",
|
|
81
|
-
"globby": "
|
|
81
|
+
"globby": "14.0.0",
|
|
82
82
|
"jasmine-core": "5.1.1",
|
|
83
83
|
"jest": "29.7.0",
|
|
84
|
-
"jest-extended": "4.0.
|
|
84
|
+
"jest-extended": "4.0.2",
|
|
85
85
|
"karma": "6.4.2",
|
|
86
86
|
"karma-chrome-launcher": "3.2.0",
|
|
87
87
|
"karma-coverage": "2.2.1",
|
|
@@ -92,14 +92,14 @@
|
|
|
92
92
|
"karma-spec-reporter": "0.0.36",
|
|
93
93
|
"less": "4.2.0",
|
|
94
94
|
"malevic": "0.19.1",
|
|
95
|
-
"prettier": "3.0
|
|
96
|
-
"puppeteer-core": "21.
|
|
97
|
-
"rollup": "
|
|
98
|
-
"rollup-plugin-istanbul": "
|
|
95
|
+
"prettier": "3.1.0",
|
|
96
|
+
"puppeteer-core": "21.5.2",
|
|
97
|
+
"rollup": "4.5.0",
|
|
98
|
+
"rollup-plugin-istanbul": "5.0.0",
|
|
99
99
|
"ts-jest": "29.1.1",
|
|
100
100
|
"tslib": "2.6.2",
|
|
101
101
|
"typescript": "5.2.2",
|
|
102
|
-
"web-ext": "7.
|
|
102
|
+
"web-ext": "7.8.0",
|
|
103
103
|
"ws": "8.14.2",
|
|
104
104
|
"yazl": "2.5.1"
|
|
105
105
|
}
|