darkreader / darkreader
- четверг, 6 декабря 2018 г. в 00:16:51
TypeScript
Dark Reader Chrome and Firefox extension
This extension inverts brightness of web pages and aims to reduce eyestrain while browsing the web. Visit Chrome Web Store and Firefox Add-ons for more info.
Donate via Open Collective.
Improve or suggest a translation here. See the list of supported language codes.
If some site is already dark, you can add it to dark-sites.config file (please, preserve alphabetical order).
If some parts of web-pages are wrongly inverted, you can specify necessary CSS selectors at dynamic-theme-fixes.config file (for Dynamic Theme mode) or inversion-fixes.config file (for Filter and Filter+ modes) (please, preserve alphabetical order by URL, use short selectors, preserve code style).
Notice that merged changes to these files are automatically delivered to all users within 15 minutes.
class="icon small"
selector may look like .icon
).================================
example.com
INVERT
.icon
INVERT
only for dark images, that are invisible on dark backgrounds (icons, diagrams, charts, <img>
and <svg>
elements).
Image analysis will be improved in future and this rule should become unnecessary.NO INVERT
rule can be used. REMOVE BG
removes background image from element.
IMPORTANT: When Dark mode is on, the whole page (root <html>
element) is inverted by filter. To revert the images, videos etc. INVERT
selectors are used, so the inversion will be applied to these elements twice. If inverted elements contain other elements that match the INVERT
selectors, then these elements will be inverted 3 or more times. To prevent it NO INVERT
selectors are used.================================
example.com
INVERT
.icon
.button
#player
NO INVERT
#player *
REMOVE BG
.bg-photo
CSS
.overlay {
background: rgba(255, 255, 255, 0.5);
}
If you would like to add new feature to Dark Reader or fix a bug, submit an issue in GitHub (if there is no existing one), discuss it with active contributors, wait for approvement.
In order to build and debug the extension install the Node.js LTS.
Install development dependencies by running npm install
in project root folder.
Then execute npm run debug
.
Open the chrome://extensions
page.
Disable the official Dark Reader version.
Enable the Developer mode.
Click Load unpacked extension button, navigate to project's debug/
folder.
Open about:addons
page.
Disable the official Dark Reader version.
Open about:debugging#addons
page.
Click Load Temporary Add-on button, open debug-firefox/manifest.json
file.
After making any code changes the project will be automatically recompiled. If the extension didn't reload automatically it can be reloaded manually on the extensions page.
For editing the code you can use any text editor or web IDE (like Visual Studio Code, Atom, WebStorm). Preserve code style (whitespaces etc).
Run tests by executing npm test
.
Submit a pull request, wait for review.
This project exists thanks to all the people who contribute
Thank you to all our backers!
Support this project by becoming a sponsor