Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

darkreader

darkreader98.1kMIT4.9.105TypeScript support: included

Dark mode for every website

dark-theme, dark-mode, night-mode, darkmode, nightmode, accessibility, eye-care

readme

Dark Reader's mascot

Dark Reader analyzes web pages and aims to reduce eyestrain while browsing the web.


Chrome Web Store Firefox Add-ons Apple App Store Edge Addons Thunderbird

Dark Reader


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.



Questions

Most questions can be answered by reading the help page. If the help page doesn't answer your question, open up a new discussion.

How to contribute

Read more about contributing to Dark Reader in CONTRIBUTING.md.

Building for use

Dark Reader build script requires a JavaScript runtime, either NodeJS or Deno. We recommend using NodeJS, Deno support is experimental.

Building with NodeJS

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.

Building with Deno

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).

Bundling with official Firefox store signatures (experimental)

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).

Using Dark Reader on a website

You can use Dark Reader to enable dark mode on your website!

  • Install the package from NPM (npm install darkreader)
  • or build from the source code (npm run api)
  • or include the script via a CDN such as unpkg or jsDelivr

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.

Site fixes

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:

  1. Click on the Dark Reader extension icon.
  2. Click on the Dev tools button (in the bottom-right corner).
  3. Go to Advanced and click on the Preview new design button.
  4. Close the developer tools window and click on the Dark Reader extension icon again.
  5. Go to 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:

  1. Click on the Dark Reader extension icon.
  2. Go to Settings -> Advanced -> Dev tools.
  3. For each "Editor" section, click on Reset changes, confirm with OK, and then click on Apply. Afterwards, close the developer tools window and reload the desired page(s).

Enable Dark Reader on restricted pages on Mozilla Firefox

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.

  1. Click on the Dark Reader extension icon.
  2. Click on the Dev tools button (in the bottom-right corner).
  3. Go to Advanced and click on the Preview new design button.
  4. Close the developer tools window and click on the Dark Reader extension icon again.
  5. Go to Settings -> Advanced and enable the Enable on restricted pages setting.

Step 2: change Firefox's settings.

  • Type about:config in the address bar and press Enter.
    • A warning page may appear. Click Accept the Risk and Continue to proceed.
  • Search for and set extensions.webextensions.restrictedDomains to an empty value (if the preference does not exist, create it with String as the type).
  • Set privacy.resistFingerprinting.block_mozAddonManager to true (if the preference does not exist, create it with 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.

Clarification about quarantined domains ("Run on sites with restrictions" option)

<summary>Quarantined domains and Dark Reader — an explanation</summary>

The option "Run on sites with restrictions", present for some extensions, is only related to quarantined domains, and is not needed for Dark Reader to work on restricted websites. In the context of Firefox's source code, "restricted domains" and "quarantined domains" are two separate things.

The "restricted domains" list (controlled by the preference extensions.webextensions.restrictedDomains) is the same for all users and will restrict all user-installed extensions (without exceptions) from running on the specified websites. The list is controlled by Mozilla, and, as of December 2024, the list only contains Mozilla-owned domains. Sites that are not on that list will not be affected by those restrictions (meaning that the extensions will be able to run normally).

The "quarantined domains" list (controlled by the preferences extensions.quarantinedDomains.enabled and extensions.quarantinedDomains.list) contain domains that will run extensions normally, but if Firefox detects suspicious activity from a particular extension it will block that extension on those specific websites. The list is controlled by Mozilla, and, as of December 2024, the list only contains domains related to internet banking in Brazil. For more information about quarantined domains, see "Why are some add-ons not allowed on sites restricted by Mozilla?".

For Dark Reader, the option "Run on sites with restrictions" is not shown because Dark Reader is a Recommended extension by Mozilla. (The "Recommended" status is only relevant for "quarantined domains", and does not affect "restricted domains".)

Due to the fact that it is a Recommended extension, it means that it meets the "highest standards of security, functionality, and user experience". The quarantined domains are only related to extension security, and because Dark Reader is considered secure by Mozilla, that option is not shown, meaning it will always run even on quarantined domains (but will still obey the "restricted domains" list if it is not empty).

Regarding quarantined domains specifically, there is this comment from Firefox's source code:

// Privileged extensions and any extensions with a recommendation state are
// exempt from the quarantined domains.

A simple way to recapitulate all this information is: "restricted domains" exist to protect Mozilla-owned sites (no user-installed extension will run on them, without exceptions), while "quarantined domains" are meant to protect users from malicious extensions (and it doesn't apply to Dark Reader because it is a Recommended extension).

Contributors


Thank you to all our contributors! Dark Reader exists thanks to you.



Backers


Thank you to all our generous backers! Support Dark Reader by becoming a backer.



Sponsors

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.

Thank you to all our wonderful sponsors!



changelog

4.9.105 (February 25, 2025)

  • API: Fixed breaking ES5 builds.

4.9.104 (February 19, 2025)

  • API: ES Module bundle.

4.9.103 (February 17, 2025)

  • Added support for more color spaces (Tailwind 4 issues).
  • Support variables in shorthand border properties of inline styles.
  • Fixed colors after style overrides were removed (Pinterest issue).
  • Fixed dark theme detection in background tabs.
  • Fixed numeric color variables.
  • Fixed same-origin CSS loading optimization.

4.9.102 (February 10, 2025)

  • MV3: Fixed background cache performance.

4.9.101 (February 7, 2025)

  • Fixed processing stylesheets with multiple CSS imports.

4.9.100 (January 29, 2025)

  • Improved performace of checking available background images.
  • Optimized image analysis caching.
  • Fixed processing style sheets with incorrect imports.
  • Fixed image analysis when extension is re-enabled.
  • Fixed theme update optimization.

4.9.99 (December 13, 2024)

  • Firefox: Fixed console error.

4.9.98 (December 13, 2024)

  • Firefox: Fixed custom browser theme.

4.9.97 (December 10, 2024)

  • Analyze only background images present on a web page.
  • Optimized rebuilding theme after configuration changes.
  • Cache image analysis results and CSS requests.
  • Improved relative CSS colors support.
  • Fixed handling custom CSS properties in inline SVGs.
  • Firefox: Optimized adopted style sheets workaround (Reddit issue).

4.9.96 (October 29, 2024)

  • Dark theme detection improvements.
  • Fixed overriding styles in Shadow DOM of built-in elements.
  • Firefox: Fix breaking Microsoft Teams.
  • Prevent dark content flashes for disabled websites.
  • Fixed loading styles with imports from same domain.

4.9.95 (October 2, 2024)

  • Fixed Google Calendar scroll bars.
  • Fixed automation panel.
  • Added links to mobile apps.

4.9.94 (September 24, 2024)

  • API: Fixed TypeScript builds.
  • Updated experimental design for Microsoft Edge for Android.

4.9.93 (September 20, 2024)

  • Experimental design for Microsoft Edge for Android.

4.9.92 (September 10, 2024)

  • Detect website's dark theme by default.
  • Use Filter mode for particular websites by default (Google Docs, Microsoft Office).
  • Restored scrollbar colors.
  • Fixed breaking on default selection color.

4.9.90 (September 1, 2024)

  • Fixed "Aw, Snap" in Google Search (Chrome and Edge on Windows).

4.9.89 (August 23, 2024)

  • Removed www part from website URLs.
  • Enabled automation and dark theme detection by default for mobile version.
  • Fixed colors for static site fixes.
  • Apply ignored image selectors for gradients.

4.9.88 (July 11, 2024)

  • Fixed breaking browser panels.

4.9.87 (June 27, 2024)

  • Added link to Settings page.
  • Fixed CSS editor layout.
  • Fixed delay when opening settings.
  • Fixed warnings for protected pages.
  • Fixed conflicts with Dark Reader based scripts.
  • Improved fallback color support in CSS variables.
  • Japanese Help page translation.

4.9.86 (May 30, 2024)

  • CSS variables performance optimizations.
  • Fixed Manifest V3 bugs.
  • Fixed loosing control over tabs after update.

4.9.85 (May 14, 2024)

  • Bulgarian translation.
  • Improved color variables support.
  • Fixed handling styles with embedded SVGs.
  • Fixed Inversion Dev Tools.
  • Fixed inline SVG image analysis.
  • Fixed overriding icon fonts.

4.9.84 (April 25, 2024)

  • Improved Dev Tools (per site editor).
  • Improved SVG logos analysis.
  • Improved large background image analysis.
  • Fixed IPv6 URL support.
  • Fixed Mark elements' colors.
  • Check for CSS @layer support.

4.9.83 (April 10, 2024)

  • Reduced memory consumption.
  • Fixed iframes background colors.
  • Optimized CSS @import loading.

4.9.82 (April 5, 2024)

  • Fixed performance issue when detecting @layer and @supports rules.
  • Improved border colors with CSS variables.
  • Leave iframes unchanged when dark theme is detected on a web page.

4.9.81 (March 29, 2024)

  • Fixed performance degradation when computer wakes up from sleep mode.
  • Improved dark theme detection.
  • Support for CSS layers.
  • Support for color mixing functions.
  • Override author's scrollbar colors.
  • Override color-scheme CSS property.
  • Fixes for backgrounds with variable colors.
  • Dynamic mode bug fixes and performance optimizations.

4.9.80 (March 13, 2024)

  • Analyze inline background images for root elements.
  • Support for "background" attribute.
  • Fixed performance for asynchronously resolved inline styles.
  • Fixed freezes and incorrect work on several websites.
  • Dev Tools: Formatting of CSS fixes.

4.9.79 (February 29, 2024)

  • Use ES2020 for API bundle.

4.9.78 (February 29, 2024)

  • Optimized Adopted Style Sheets changes handling.
  • Fixed watching for style/link element position changes.
  • Fixed processing large style elements loaded by chunks.
  • Fixed enabling the extension with a hotkey after it was disabled automatically.
  • Fixed sliders in mobile UI.

4.9.77 (February 7, 2024)

  • Firefox: Fixed errors when Adopted Style Sheets were not present.
  • Fixed breaking on ::view-transition selectors (Airbnb issue).

4.9.76 (January 17, 2024)

  • Improved dark theme detection.
  • Dynamic mode bug fixes.

4.9.75 (January 12, 2024)

  • Fixed CSS variables processing in inline styles.
  • Chrome: Improved Adopted Style Sheets support (Bing AI and Copilot issues).
  • Firefox: Adopted Style Sheets support.
  • Firefox: Fixed issues with Filter+ mode.
  • Improved Constructed Style Sheets changes handling.

4.9.74 (January 3, 2024)

  • Improved image analysis performance.
  • Improved dark theme detection.
  • Fixed 404 errors when loading images with relative paths.
  • v5 Preview: Moved settings into a separate page.

4.9.73 (December 6, 2023)

  • Fixed URL subdomain handling.

4.9.72 (December 5, 2023)

  • Fixed Salesforce and Excel Online issues.

4.9.71 (December 5, 2023)

  • Improved subdomain handling in Site List.
  • Improved dark theme detection.
  • Fixed page crashes (Slack issue).
  • Fixed Site List migration.
  • Reduced image analysis memory usage.

4.9.70 (November 22, 2023)

  • Fixed clearing site lists when synchronization is disabled.

4.9.69 (November 21, 2023)

  • Separated Enabled and Disabled site lists.
  • Regular expressions support in Site List.
  • Fixed automation after computer waking up.

4.9.68 (November 13, 2023)

  • Fixed incorrect CSS comment handling (Reddit issue #11583).
  • Fixed working on domains containing constructor part (#11877).

4.9.67 (October 1, 2023)

  • Fixed Site List when there is any URL with port.

4.9.66 (September 25, 2023)

  • Dynamic mode fixes.
  • UI improvements.

4.9.65 (August 7, 2023)

  • Optimize inline style handling (fixes DuckDuckGo issue).
  • Added an option to enable/disable the extension for all websites by default.

4.9.64 (June 21, 2023)

  • Using passive event listeners (#11047)
  • Fixed System Automation on Firefox (#10237)
  • Fixed News section.

4.9.63 (Apr 10, 2023)

  • Site toggle panel (detect dark theme and shortcut).
  • App toggle panel (automation and shortcut).
  • Improved Site List indexing.

4.9.62 (Jan 8, 2023)

  • Fixed a edge case with extracting color numbers, it's now able to extract rgb(0 0 0/0.04). (#10565)
  • Improved IPv6 check. (#10564)
  • Faster UI loading. (#10589)

4.9.61 (Jan 2, 2023)

  • Only invert PDFs on mail.google.com and drive.google.com, if the setting for PDF inversion has been enabled. (#10310)
  • Show in the new UI design when a page is disabled, because it's protected by the browser. (#10338)
  • Improved restoring Dark Reader elements, when the whole DOM is being overwritten. (#10372)

4.9.60 (Oct 27, 2022)

  • Fixed broken hotkeys.
  • Improved IP v6 address support.

4.9.59 (Oct 23, 2022)

  • Fixes a issue where darkreader-fallback wasn't removed from the DOM, when Dark Reader finds a <meta name="darkreader-lock"> element.
  • Be stricter when the user specifies a last slash for a URL in the Site List.
  • Display a warning that "System" Automation might not work properly in Chromium on Linux and Kiwi on Android.
  • Workaround for Kiwi file download during settings import, fix opening Dark Reader DevTools.
  • A button to clear the Site List (v5 Preview UI).

4.9.58 (Sep 22, 2022)

  • Remove newlines from CSS URL values, before handling them.
  • Better detection for text color property in variables.
  • es-419 (Latin America & Caribbean Spanish) translation.
  • Updates to Hebrew and Portuguese (Brazilian) translations.

4.9.57 (Aug 23, 2022)

  • Fix iframes not getting modified when settings were changed.
  • Fixed registering system automation handlers multiple times.

4.9.56 (Aug 16, 2022)

  • Fix browser theme not changing when automation + scheme behavior was enabled.

4.9.55 (Aug 10, 2022)

  • Fix Google calendar.
  • Fix Opera/Vivaldi sidebar's getting modified.
  • Fix incorrect inline background colors when mask is explicitly disabled.
  • Fixed breaking for some old browser versions.

4.9.54 (Aug 10, 2022)

  • Fixed System automation.

4.9.53 (Aug 9, 2022)

  • Don't manage styles that have an empty href attribute.
  • Use navigator.UserAgentData when possible.
  • Add a <meta name="darkreader-lock"> detector, to disable Dark Reader when detected (only dynamic theme).
  • Fix filter theme for Firefox v102+
  • Correctly open static theme editor on Mobile.
  • Migrate automation settings to its own object.
  • Correctly handle empty URL's in background-image property.
  • Make color parsing use cache.
  • Send updates only to affected tabs when toggling sites.
  • Fixed images with masks (Gmail icons issue).
  • Background page refactoring.

4.9.52 (June 28, 2022)

  • Correctly handle escaped characters in CSS url(...) values.

4.9.51 (May 27, 2022)

Dynamic mode improvements:

  • Fixed CSS imports that contain url(...) and end with screen.
  • Send network responses to correct frames in tabs.
  • Improved calc(...) color handling by using Shunting Yard algorithm.

New translations:

  • Malay translation.
  • Telugu translation.

Other:

  • UI improvements.
  • Users' fixes for websites.

4.9.50 (May 1, 2022)

  • Fix working in Firefox Nightly 101.
  • Users' fixes for websites.

4.9.48 (Apr 18, 2022)

  • Fix PDF inversion when Auto-detect dark theme option was enabled.
  • Fix Jira's background.
  • User's settings validation.
  • Users' fixes for websites.

4.9.47 (Mar 14, 2022)

  • Users' fixes for websites.

4.9.46 (Mar 10, 2022)

  • v5 Preview: Auto-detect dark theme on websites.
  • v5 Preview: Option for running dark theme on hidden tabs immediately.
  • Dynamic mode bug fixes.
  • Translation improvements.
  • Users' fixes for websites.

4.9.45 (Feb 5, 2022)

  • Revert reducing brightness for images (due to some performance issues).
  • Users' fixes for websites.

4.9.44 (Feb 4, 2022)

  • Dynamic mode improvements.
  • v5 preview: Ability to automate dark/light scheme.
  • Users' fixes for websites.

4.9.43 (Dec 7, 2021)

  • Dynamic mode bug fixes.
  • Users' fixes for websites.

4.9.42 (Nov 6, 2021)

  • Fixed slow performance on some websites.
  • Fixed broken UI for some users.
  • Users' fixes for websites.

4.9.41 (Nov 5, 2021)

  • Fixed white flash when page starts loading.
  • Users' fixes for websites.

4.9.40 (Nov 3, 2021)

  • Dynamic mode fixes.
  • Filipino translation (thanks to @IverCoder).
  • Serbian translation (thanks to Nemanja @nebocoder).
  • Users' fixes for websites.

4.9.39 (Oct 1, 2021)

  • Fixed settings not being saved.
  • Fixed not working popup for some users.
  • Dynamic mode performance improvements.
  • v5 Preview design update.
  • Users' fixes for websites.

4.9.37.1 (Sep 23, 2021)

  • Fixed error when applying settings after some time.
  • Users' fixes for websites.

4.9.36 (Sep 21, 2021)

  • Fixed regression bugs after 4.9.35 release (hotkeys, Dev Tools, sunrise/sunset).
  • Users' fixes for websites.

4.9.35 (Sep 19, 2021)

  • Preparing the app for work in non-persistent background context.
  • Dynamic mode bug fixes and performance improvements.
  • Users' fixes for websites.

4.9.34 (Jul 7, 2021)

  • Dynamic mode bug fixes and performance improvements.
  • Minor UI improvements.
  • Users' fixes for websites.

4.9.33 (May 28, 2021)

  • Fixed disability to switch on sites in Global Dark List.
  • Bug fixes.
  • Users' fixes for websites.

4.9.32 (Apr 21, 2021)

  • Dynamic mode bug fixes.
  • Users' fixes for websites.

4.9.31 (Apr 5, 2021)

  • Fixed performance bottleneck for websites with CSS variables.
  • Users' fixes for websites.

4.9.30 (Apr 1, 2021)

  • Improved CSS Variables support.
  • Dynamic mode bug fixes.
  • Fixed toggle shortcut keys for PDFs.
  • Users' fixes for websites.

4.9.29 (Feb 22, 2021)

  • Users' fixes for websites.

4.9.27 (Jan 21, 2021)

  • Dynamic mode improvements.
  • Thunderbird support.
  • Users' fixes for websites.
  • Users' translation improvements.

4.9.26 (Nov 26, 2020)

  • Dynamic mode bug fixes.
  • Users' fixes for websites.

4.9.25 (Nov 25, 2020)

  • Dynamic mode bug fixes.
  • Users' fixes for websites.

4.9.24 (Nov 19, 2020)

  • Dynamic mode fixes and performance improvements.
  • Updates for Dutch translation.
  • Users' fixes for websites.
  • Reduced assets size.

4.9.23 (Oct 26, 2020)

  • Fixed missing images on some websites.

4.9.22 (Oct 26, 2020)

  • Fixed high CPU usage caused by conflict with some websites.
  • Dynamic mode bug fixes.
  • Users' fixes for websites.

4.9.21 (Sep 26, 2020)

  • Fixed wrongly displaying pages where the extension is disabled.