darkreader 4.9.86 → 4.9.87
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 +1 -1
- package/darkreader.js +53 -6
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<p align="center"><a href="https://darkreader.org" target="_blank" rel="noreferrer noopener"><img width="250" alt="Dark Reader's mascot" src="https://raw.githubusercontent.com/darkreader/darkreader.github.io/master/images/darkreader-mascot.svg"></a></p>
|
|
2
2
|
<p align="center">Dark Reader <strong>analyzes</strong> web pages and aims to <strong>reduce eyestrain</strong> while browsing the web.</p>
|
|
3
3
|
<br/>
|
|
4
|
-
<p align="center"><a rel="noreferrer noopener" href="https://
|
|
4
|
+
<p align="center"><a rel="noreferrer noopener" href="https://chromewebstore.google.com/detail/dark-reader/eimadpbcbfnmbkopoojfekhnkhdbieeh"><img alt="Chrome Web Store" src="https://img.shields.io/badge/Chrome-141e24.svg?&style=for-the-badge&logo=google-chrome&logoColor=white"></a> <a rel="noreferrer noopener" href="https://addons.mozilla.org/firefox/addon/darkreader/"><img alt="Firefox Add-ons" src="https://img.shields.io/badge/Firefox-141e24.svg?&style=for-the-badge&logo=firefox-browser&logoColor=white"></a> <a rel="noreferrer noopener" href="https://darkreader.org/safari/"><img alt="Apple App Store" src="https://img.shields.io/badge/Safari-141e24.svg?&style=for-the-badge&logo=safari&logoColor=white"></a> <a rel="noreferrer noopener" href="https://microsoftedge.microsoft.com/addons/detail/dark-reader/ifoakfbpdcdoeenechcleahebpibofpc/"><img alt="Edge Addons" src="https://img.shields.io/badge/Edge-141e24.svg?&style=for-the-badge&logo=microsoft-edge&logoColor=white"></a> <a el="noreferrer noopener" href="https://addons.thunderbird.net/thunderbird/addon/darkreader"><img alt="Thunderbird" src="https://img.shields.io/badge/Thunderbird-141e24.svg?&style=for-the-badge&logo=thunderbird&logoColor=white"></a>
|
|
5
5
|
|
|
6
6
|
<h2 align="center">Dark Reader</h2>
|
|
7
7
|
<br/>
|
package/darkreader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Dark Reader v4.9.
|
|
2
|
+
* Dark Reader v4.9.87
|
|
3
3
|
* https://darkreader.org/
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -3646,7 +3646,7 @@
|
|
|
3646
3646
|
const modified = modify();
|
|
3647
3647
|
if (unknownVars.size > 0) {
|
|
3648
3648
|
const isFallbackResolved = modified.match(
|
|
3649
|
-
/^var\(.*?, var\(--darkreader-bg--.*\)\)$/
|
|
3649
|
+
/^var\(.*?, (var\(--darkreader-bg--.*\))|(#[0-9A-Fa-f]+)|([a-z]+)|(rgba?\(.+\))|(hsla?\(.+\))\)$/
|
|
3650
3650
|
);
|
|
3651
3651
|
if (isFallbackResolved) {
|
|
3652
3652
|
return modified;
|
|
@@ -6347,7 +6347,19 @@
|
|
|
6347
6347
|
document.addEventListener(type, listener, options);
|
|
6348
6348
|
cleaners.push(() => document.removeEventListener(type, listener));
|
|
6349
6349
|
}
|
|
6350
|
+
function disableConflictingPlugins() {
|
|
6351
|
+
const disableWPDarkMode = () => {
|
|
6352
|
+
if (window?.WPDarkMode?.deactivate) {
|
|
6353
|
+
window.WPDarkMode.deactivate();
|
|
6354
|
+
}
|
|
6355
|
+
};
|
|
6356
|
+
disableWPDarkMode();
|
|
6357
|
+
}
|
|
6350
6358
|
documentEventListener("__darkreader__cleanUp", cleanUp);
|
|
6359
|
+
documentEventListener(
|
|
6360
|
+
"__darkreader__disableConflictingPlugins",
|
|
6361
|
+
disableConflictingPlugins
|
|
6362
|
+
);
|
|
6351
6363
|
function overrideProperty(cls, prop, overrides) {
|
|
6352
6364
|
const proto = cls.prototype;
|
|
6353
6365
|
const oldDescriptor = Object.getOwnPropertyDescriptor(proto, prop);
|
|
@@ -7326,10 +7338,10 @@
|
|
|
7326
7338
|
metaElement.content = INSTANCE_ID;
|
|
7327
7339
|
document.head.appendChild(metaElement);
|
|
7328
7340
|
}
|
|
7341
|
+
function isDRLocked() {
|
|
7342
|
+
return document.querySelector('meta[name="darkreader-lock"]') != null;
|
|
7343
|
+
}
|
|
7329
7344
|
function isAnotherDarkReaderInstanceActive() {
|
|
7330
|
-
if (document.querySelector('meta[name="darkreader-lock"]')) {
|
|
7331
|
-
return true;
|
|
7332
|
-
}
|
|
7333
7345
|
const meta = document.querySelector('meta[name="darkreader"]');
|
|
7334
7346
|
if (meta) {
|
|
7335
7347
|
if (meta.content !== INSTANCE_ID) {
|
|
@@ -7359,6 +7371,38 @@
|
|
|
7359
7371
|
success();
|
|
7360
7372
|
});
|
|
7361
7373
|
}
|
|
7374
|
+
function disableConflictingPlugins() {
|
|
7375
|
+
if (document.documentElement.hasAttribute("data-wp-dark-mode-preset")) {
|
|
7376
|
+
const disableWPDarkMode = () => {
|
|
7377
|
+
document.dispatchEvent(
|
|
7378
|
+
new CustomEvent("__darkreader__disableConflictingPlugins")
|
|
7379
|
+
);
|
|
7380
|
+
document.documentElement.classList.remove(
|
|
7381
|
+
"wp-dark-mode-active"
|
|
7382
|
+
);
|
|
7383
|
+
document.documentElement.removeAttribute(
|
|
7384
|
+
"data-wp-dark-mode-active"
|
|
7385
|
+
);
|
|
7386
|
+
};
|
|
7387
|
+
disableWPDarkMode();
|
|
7388
|
+
const observer = new MutationObserver(() => {
|
|
7389
|
+
if (
|
|
7390
|
+
document.documentElement.classList.contains(
|
|
7391
|
+
"wp-dark-mode-active"
|
|
7392
|
+
) ||
|
|
7393
|
+
document.documentElement.hasAttribute(
|
|
7394
|
+
"data-wp-dark-mode-active"
|
|
7395
|
+
)
|
|
7396
|
+
) {
|
|
7397
|
+
disableWPDarkMode();
|
|
7398
|
+
}
|
|
7399
|
+
});
|
|
7400
|
+
observer.observe(document.documentElement, {
|
|
7401
|
+
attributes: true,
|
|
7402
|
+
attributeFilter: ["class", "data-wp-dark-mode-active"]
|
|
7403
|
+
});
|
|
7404
|
+
}
|
|
7405
|
+
}
|
|
7362
7406
|
function createOrUpdateDynamicThemeInternal(
|
|
7363
7407
|
themeConfig,
|
|
7364
7408
|
dynamicThemeFixes,
|
|
@@ -7387,6 +7431,7 @@
|
|
|
7387
7431
|
isIFrame$1 = iframe;
|
|
7388
7432
|
const ready = () => {
|
|
7389
7433
|
const success = () => {
|
|
7434
|
+
disableConflictingPlugins();
|
|
7390
7435
|
document.documentElement.setAttribute(
|
|
7391
7436
|
"data-darkreader-mode",
|
|
7392
7437
|
"dynamic"
|
|
@@ -7400,7 +7445,9 @@
|
|
|
7400
7445
|
const failure = () => {
|
|
7401
7446
|
removeDynamicTheme();
|
|
7402
7447
|
};
|
|
7403
|
-
if (
|
|
7448
|
+
if (isDRLocked()) {
|
|
7449
|
+
removeNode(document.querySelector(".darkreader--fallback"));
|
|
7450
|
+
} else if (isAnotherDarkReaderInstanceActive()) {
|
|
7404
7451
|
interceptOldScript({
|
|
7405
7452
|
success,
|
|
7406
7453
|
failure
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "darkreader",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.87",
|
|
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,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@rollup/plugin-node-resolve": "15.2.3",
|
|
60
|
-
"@rollup/plugin-replace": "5.0.
|
|
60
|
+
"@rollup/plugin-replace": "5.0.7",
|
|
61
61
|
"@rollup/plugin-typescript": "11.1.6",
|
|
62
62
|
"@types/chrome": "0.0.268",
|
|
63
63
|
"@types/eslint": "8.56.10",
|
|
@@ -65,13 +65,13 @@
|
|
|
65
65
|
"@types/jest": "29.5.12",
|
|
66
66
|
"@types/karma": "6.3.8",
|
|
67
67
|
"@types/karma-coverage": "2.0.3",
|
|
68
|
-
"@types/node": "20.
|
|
68
|
+
"@types/node": "20.14.9",
|
|
69
69
|
"@types/ws": "8.5.10",
|
|
70
|
-
"@typescript-eslint/eslint-plugin": "7.
|
|
71
|
-
"@typescript-eslint/parser": "7.
|
|
70
|
+
"@typescript-eslint/eslint-plugin": "7.14.1",
|
|
71
|
+
"@typescript-eslint/parser": "7.14.1",
|
|
72
72
|
"chokidar": "3.6.0",
|
|
73
73
|
"eslint": "8.57.0",
|
|
74
|
-
"eslint-plugin-compat": "
|
|
74
|
+
"eslint-plugin-compat": "5.0.0",
|
|
75
75
|
"eslint-plugin-import": "2.29.1",
|
|
76
76
|
"eslint-plugin-local": "4.2.2",
|
|
77
77
|
"globby": "14.0.1",
|
|
@@ -88,15 +88,15 @@
|
|
|
88
88
|
"karma-spec-reporter": "0.0.36",
|
|
89
89
|
"less": "4.2.0",
|
|
90
90
|
"malevic": "0.20.1",
|
|
91
|
-
"prettier": "3.2
|
|
92
|
-
"puppeteer-core": "22.
|
|
93
|
-
"rollup": "4.
|
|
91
|
+
"prettier": "3.3.2",
|
|
92
|
+
"puppeteer-core": "22.12.1",
|
|
93
|
+
"rollup": "4.18.0",
|
|
94
94
|
"rollup-plugin-istanbul": "5.0.0",
|
|
95
|
-
"ts-jest": "29.1.
|
|
96
|
-
"tslib": "2.6.
|
|
97
|
-
"typescript": "5.
|
|
98
|
-
"web-ext": "
|
|
99
|
-
"ws": "8.17.
|
|
95
|
+
"ts-jest": "29.1.5",
|
|
96
|
+
"tslib": "2.6.3",
|
|
97
|
+
"typescript": "5.5.2",
|
|
98
|
+
"web-ext": "8.2.0",
|
|
99
|
+
"ws": "8.17.1",
|
|
100
100
|
"yazl": "2.5.1"
|
|
101
101
|
}
|
|
102
102
|
}
|