GithubHelp home page GithubHelp logo

ivan / darkreader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from darkreader/darkreader

1.0 1.0 0.0 25.32 MB

Dark Reader Chrome and Firefox extension

Home Page: https://darkreader.org/

License: MIT License

JavaScript 8.47% TypeScript 83.38% HTML 0.15% Less 7.99%

darkreader's Introduction

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

You can install the extension from a file.
Install Node.js LTS. Download the source code (or check out from git).
Open the terminal in the root folder and run:

  • npm install
  • npm run build

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.

Using Dark Reader for 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 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.

Site fixes

Automatically syncing the site fixes to every Dark Reader user was disabled because the GitHub team does not allow using GitHub as a 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 these changes.

However, this can be enabled using the following steps:

  • Click on the Dark Reader icon.
  • Click on the Dev tools button (in the bottom-right corner).
  • Click on the Preview new design button.
  • Enable the Synchronize site fixes setting under Settings -> Manage Settings.

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? 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!



darkreader's People

Contributors

alexalekseyenko avatar alexanderby avatar andrew-j-larson avatar banonotit avatar bershanskiy avatar c-nagy avatar dependabot[bot] avatar elaborendum avatar erkinalp avatar fademind avatar felixonmars avatar gitoffthelawn avatar grelo4ka avatar gusted avatar isaec avatar jemsurfer avatar jtraub avatar linsui avatar merajmasuk avatar mertyn avatar mukundan314 avatar myshor avatar omarnamis avatar pnaf avatar qtlunya avatar rakleed avatar sprinkledcheese avatar vulcansphere avatar xxyzz avatar yash-singh1 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.