darkreader 4.9.58 → 4.9.67

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.
Files changed (4) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +31 -8
  3. package/darkreader.js +638 -293
  4. package/package.json +52 -48
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Dark Reader Ltd.
3
+ Copyright (c) 2023 Dark Reader Ltd.
4
4
 
5
5
  All rights reserved.
6
6
 
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
- You can install the extension from a file.
24
- Install [Node.js LTS](https://nodejs.org/en/). Download the source code (or check out from git).
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 darkreader 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.
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,7 +126,7 @@ 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
 
106
- To force a synchronization of the sites fixes (when the corresponding setting is enabled), use the following steps:
129
+ To force a synchronization of the sites fixes (when the corresponding setting is enabled), perform the following steps:
107
130
 
108
131
  - Click on the Dark Reader icon.
109
132
  - Click on the Dev tools button (in the bottom-right corner).
@@ -124,7 +147,7 @@ To force a synchronization of the sites fixes (when the corresponding setting is
124
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>
125
148
 
126
149
  <h2 align="center">Sponsors</h2>
127
- <p>Does your company use Dark Reader? 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>
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>
128
151
 
129
152
  <h3 align="center"><strong>Thank you to all our wonderful sponsors!</strong></h3>
130
153
  <br/>