darkreader 4.9.57 → 4.9.66
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/LICENSE +1 -1
- package/README.md +36 -7
- package/darkreader.js +7872 -5466
- package/package.json +53 -48
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -20,15 +20,38 @@ Read more about contributing to Dark Reader in [CONTRIBUTING.md](https://github.
|
|
|
20
20
|
|
|
21
21
|
## Building for use
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
Dark Reader build script requires a JavaScript runtime, either NodeJS or Deno. We recommend using NodeJS, Deno support is experimental.
|
|
24
|
+
|
|
25
|
+
### Building with NodeJS
|
|
26
|
+
|
|
27
|
+
You can install the extension from a file.
|
|
28
|
+
Install [Node.js](https://nodejs.org/) (we recommend LTS or higher, but any version at or above 15 will work). Download the source code (or check out from git).
|
|
25
29
|
Open the terminal in the root folder and run:
|
|
26
30
|
|
|
27
31
|
- `npm install`
|
|
28
|
-
- `npm run build`
|
|
32
|
+
- `npm run build` or `npm run build [-- flags]`
|
|
29
33
|
|
|
30
34
|
This will create a `build/release/darkreader-chrome.zip` file for use in a Chromium-based browser and a `build/release/darkreader-firefox.xpi` file for use in Firefox.
|
|
31
35
|
|
|
36
|
+
You can customize build process by passing flags to build script. To see all flags, run `npm run build -- --help`.
|
|
37
|
+
|
|
38
|
+
### Building with Deno
|
|
39
|
+
|
|
40
|
+
You can build Dark Reader with alternative runtime called [Deno](https://deno.land/). For this run `deno:bootstrap` script (e.g., via `npm run deno:bootstrap` or manually copy the command from `package.json`). Then run the same commands described above.
|
|
41
|
+
|
|
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
|
+
|
|
44
|
+
### Bundling with official Firefox store signatures (Experimental)
|
|
45
|
+
|
|
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
|
+
|
|
48
|
+
Dark Reader repository contains these digital signatures and you can add them to the extension bundle. The following will build Dark Reader for Firefox version 4.9.63:
|
|
49
|
+
```
|
|
50
|
+
npm run build -- --firefox --version=4.9.63
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Please note that only Firefox Add-ons store signatures are present in the repositiry right now. Also, due to NodeJS and TypeScript version compatibility, one might have to first check out the old revision (commit), then build the extension files, then check out the recent commit and create the bundle (by running only `signature` and `zip` steps).
|
|
54
|
+
|
|
32
55
|
## Using Dark Reader for a website
|
|
33
56
|
|
|
34
57
|
You can use Dark Reader to enable dark mode on your website!
|
|
@@ -37,7 +60,7 @@ You can use Dark Reader to enable dark mode on your website!
|
|
|
37
60
|
- or build from the source code (`npm run api`)
|
|
38
61
|
- or include the script via a CDN such as [unpkg](https://unpkg.com/darkreader/) or [jsDelivr](https://www.jsdelivr.com/package/npm/darkreader)
|
|
39
62
|
|
|
40
|
-
Then you can use the following code to control Dark Reader's API
|
|
63
|
+
Then you can use the following code to control Dark Reader's API:
|
|
41
64
|
```javascript
|
|
42
65
|
DarkReader.enable({
|
|
43
66
|
brightness: 100,
|
|
@@ -64,7 +87,7 @@ const CSS = await DarkReader.exportGeneratedCSS();
|
|
|
64
87
|
const isEnabled = DarkReader.isEnabled();
|
|
65
88
|
```
|
|
66
89
|
|
|
67
|
-
... or if you are using ES modules
|
|
90
|
+
... or if you are using ES modules:
|
|
68
91
|
|
|
69
92
|
```javascript
|
|
70
93
|
import {
|
|
@@ -90,7 +113,7 @@ const CSS = await collectCSS();
|
|
|
90
113
|
const isEnabled = isDarkReaderEnabled();
|
|
91
114
|
```
|
|
92
115
|
|
|
93
|
-
Be aware that
|
|
116
|
+
Be aware that Dark Reader will add the `chrome` object onto the `window` object. These are to stub certain functions that the code will use. They originate from the webextension-api.
|
|
94
117
|
|
|
95
118
|
## Site fixes
|
|
96
119
|
|
|
@@ -103,6 +126,12 @@ However, this can be enabled using the following steps:
|
|
|
103
126
|
- Click on the Preview new design button.
|
|
104
127
|
- Enable the `Synchronize site fixes` setting under `Settings -> Manage Settings`.
|
|
105
128
|
|
|
129
|
+
To force a synchronization of the sites fixes (when the corresponding setting is enabled), perform the following steps:
|
|
130
|
+
|
|
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.
|
|
134
|
+
|
|
106
135
|
<h2 align="center">Contributors</h2>
|
|
107
136
|
<br/>
|
|
108
137
|
<h3 align="center"><strong>Thank you to all our contributors! Dark Reader exists thanks to you.</strong></h3>
|
|
@@ -118,7 +147,7 @@ However, this can be enabled using the following steps:
|
|
|
118
147
|
<p align="center"><a rel="noreferrer noopener" href="https://opencollective.com/darkreader#backers" target="_blank"><img src="https://opencollective.com/darkreader/backers.svg?width=890&limit=1000"></a></p>
|
|
119
148
|
|
|
120
149
|
<h2 align="center">Sponsors</h2>
|
|
121
|
-
<p>Does your company use Dark Reader?
|
|
150
|
+
<p>Does your company use Dark Reader? Please ask your manager or the marketing team if your company would be interested in supporting our project. Your support will allow the maintainers to dedicate more time to maintenance and creating new features for everyone. Also, your company's logo will show on <a rel="noreferrer noopener" href="https://github.com/darkreader/darkreader#sponsors" target="_blank">GitHub</a>. Who doesn't want a little extra exposure? <a rel="noreferrer noopener" href="https://opencollective.com/darkreader" target="_blank">Here's the info</a>.</p>
|
|
122
151
|
|
|
123
152
|
<h3 align="center"><strong>Thank you to all our wonderful sponsors!</strong></h3>
|
|
124
153
|
<br/>
|