NoBrighter

Change element's background color that is too bright to a light green.

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

You will need to install an extension such as Tampermonkey to install this script.

Necesitarás instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Necesitará instalar una extensión como Tampermonkey para instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

Autor
henix
Instalaciones diarias
1
Instalaciones totales
1.621
Calificaciones
12 1 0
Versión
20160608.1
Creado
15/5/2014
Actualizado
7/6/2016
Tamaño
4,05 KB
Licencia
MIT
Funciona en
Todos los sitios

Change element's background color that is too bright to a light green.

Although there are many similar scripts (http://userscripts-mirror.org/scripts/show/114652 , http://userscripts.org/scripts/show/109390) could do the same job, this script has its unique features:

Features

  1. Determine whether a color should be changed by it's lightness.
  2. You can add some websites as "long running site". For some websites updating their contents via ajax(e.g. Google Docs / Twitter), NoBrighter can run forever and convert background color periodically.

(Tech note: this feature could be implemented by listening DOMNodeInserted event, but due to it's bad performance impact, I use setInterval instead.)

Customization

You can edit the script to set your own:

  1. lightness threshold
  2. the color to change to
  3. long running site list (a list of hostnames)

See the config section in the code.

Friends

NoBrighter works better with other eye-protection settings and softwares:

1. Set window's background color for Windows:

[HKEY_CURRENT_USER\Control Panel\Colors]
"Window"="168 215 174"

2. f.lux (or Redshift for Linux)

Changelog

see https://github.com/henix/userjs/commits/master/NoBrighter.js

2013-12-4

  • changeTransparent should be called on tag, because it can set background-color. fix #1
  • Provided other colors, you can uncomment them to use. The number after them is brightness.
  • if html or body have set background-color, do not changeTransparent. Fix #2

2013-6-17 The latest version of TamperMonkey don't support "*", change to "http://*" and "https://*"

2012-8-16 Change transparent body only when in top frame There could be a transparent iframe in a dark parent frame, in which case the old logic will do wrong

2012-7-19 Remove prependSheet because it may clash with [body bgcolor="XX"]

2012-7-15 Exclude boards.4chan.org

2012-7-14 Use css stylesheet to set body's default background-color

2012-7-12 Version 0.1