NoBrighter

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

当前为 2014-06-20 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
henix
评分
0 0 0
版本
20140620.1
创建于
2014-05-15
更新于
2014-06-20
大小
4.0 KB
许可证
MIT
适用于
所有网站

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

Although there are many similar scripts (http://userscripts.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.

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