Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
darkreader
Advanced tools
Dark Reader analyzes web pages and aims to reduce eyestrain while browsing the web.
Dark Reader is an open-source MIT-licensed browser extension designed to analyze web pages. Dark Reader will generate a dark mode that aims to reduce the eyestrain of the user. Dark Reader is feature-rich and is customizable in many ways throughout the UI.
Most questions can be answered by reading the help page. If the help page doesn't answer your question, open up a new discussion.
Read more about contributing to Dark Reader in CONTRIBUTING.md.
Dark Reader build script requires a JavaScript runtime, either NodeJS or Deno. We recommend using NodeJS, Deno support is experimental.
You can install the extension from a file. Install Node.js (we recommend LTS or higher, but any version at or above 15 will work). Download the source code (or check out from git). Open the terminal in the root folder and run:
npm install
npm run build
or npm run build [-- flags]
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.
You can customize build process by passing flags to build script. To see all flags, run npm run build -- --help
.
You can build Dark Reader with alternative runtime called Deno. 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.
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).
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 performed very basic extension validation.
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:
npm run build -- --firefox --version=4.9.63
Please note that only Firefox Add-ons store signatures are present in the repository 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).
You can use Dark Reader to enable dark mode on your website!
npm install darkreader
)npm run api
)Then you can use the following code to control Dark Reader's API:
DarkReader.enable({
brightness: 100,
contrast: 90,
sepia: 10
});
DarkReader.disable();
// Enable when the system color scheme is dark.
DarkReader.auto({
brightness: 100,
contrast: 90,
sepia: 10
});
// Stop watching for the system color scheme.
DarkReader.auto(false);
// Get the generated CSS of Dark Reader returned as a string.
const CSS = await DarkReader.exportGeneratedCSS();
// Check if Dark Reader is enabled.
const isEnabled = DarkReader.isEnabled();
... or if you are using ES modules:
import {
enable as enableDarkMode,
disable as disableDarkMode,
auto as followSystemColorScheme,
exportGeneratedCSS as collectCSS,
isEnabled as isDarkReaderEnabled
} from 'darkreader';
enableDarkMode({
brightness: 100,
contrast: 90,
sepia: 10,
});
disableDarkMode();
followSystemColorScheme();
const CSS = await collectCSS();
const isEnabled = isDarkReaderEnabled();
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.
Automatically syncing the site fixes for every Dark Reader user was disabled because the GitHub team does not allow using GitHub as a content delivery network (CDN). The storage of these files would be expensive, and making requests to other resources would look suspicious. Each new release of Dark Reader will include the new changes.
However, this can be manually enabled with the following steps:
Dev tools
button (in the bottom-right corner).Advanced
and click on the Preview new design
button.Settings
-> Advanced
and enable the Synchronize sites fixes
setting.To force a synchronization of the sites fixes (when the corresponding setting is enabled), perform the following steps:
Settings
-> Advanced
-> Dev tools
.Reset changes
, confirm with OK
, and then click on Apply
. Afterwards, close the developer tools window and reload the desired page(s).By default, Dark Reader does not work on some websites due to security restrictions enforced by Mozilla.
The following instructions will guide you on how to disable those restrictions.
Proceed with caution. This exposes you to a security risk if you do not know what you are doing.
Be sure that you do not have any suspicious or malicious-looking extension installed before proceeding.
These settings will apply to all extensions, and not just Dark Reader.
Step 1: change Dark Reader's settings.
Dev tools
button (in the bottom-right corner).Advanced
and click on the Preview new design
button.Settings
-> Advanced
and enable the Enable on restricted pages
setting.Step 2: change Firefox's settings.
about:config
in the address bar and press Enter.
Accept the Risk and Continue
to proceed.extensions.webextensions.restrictedDomains
to an empty value (if the preference does not exist, create with it String
as the type).privacy.resistFingerprinting.block_mozAddonManager
to true
(if the preference does not exist, create with it Boolean
as the type).After changing the necessary settings for both Dark Reader and Firefox, reload the desired page(s).
If you had previously changed any of the following preferences, please reset them to their default values as they are only related to security and are not necessary for Dark Reader to work on restricted websites.
To reset them, click on the reset (or delete icon, if present) icon at the most-right corner of the preference line in about:config
.
extensions.webextensions.addons-restricted-domains@mozilla.com.disabled
extensions.quarantinedDomains.enabled
extensions.quarantinedDomains.list
The option "Run on sites with restrictions", present in some extensions, is only related to quarantined domains, and is not needed for Dark Reader to work on restricted websites.
More information about quarantined domains: Why are some add-ons not allowed on sites restricted by Mozilla?
For Dark Reader, the option is not shown because Dark Reader is a Recommended extension by Mozilla.
Due to it being a Recommended extension, it means it meets the "highest standards of security, functionality, and user experience". The quarantined domains are only related to security, and because Dark Reader is considered secure by Mozilla, that option is not shown, meaning it will always run even on quarantined domains.
// Privileged extensions and any extensions with a recommendation state are
// exempt from the quarantined domains.
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 GitHub. Who doesn't want a little extra exposure? Here's the info.
4.9.96 (October 29, 2024)
FAQs
Dark mode for every website
We found that darkreader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.