defBackgroundUp

Replace #FFFFFF backgrounds in #ECF2EA rgb(236, 242, 234),is more natural ergonomic color for your eyes, natural contrast.

当前为 2016-08-27 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name defBackgroundUp
  3. // @description Replace #FFFFFF backgrounds in #ECF2EA rgb(236, 242, 234),is more natural ergonomic color for your eyes, natural contrast.
  4. // @include *
  5. // grant none
  6. // @namespace https://greasyfork.org/en/users/3561-lucianolll
  7. // @namespace https://openuserjs.org/users/lucianolll
  8. // @version 12
  9. // ==/UserScript==
  10. var confBackg=function(){
  11. var doc=document,getref=['body','table','td','div','html','dl','ul','pre'],
  12. abg=function(tg){var tgs=function(d){return getComputedStyle(tg[d],null).backgroundColor=='rgb(255, 255, 255)';};return function(d){return tgs(d);};},
  13. ts=function(tg){var tcs=function(d){return tg[d].style;};return function(d){return tcs(d);};};
  14. for(var a=8,n=0,tag,at,tf,tmp=[];a--;){
  15. tag=doc.getElementsByTagName(getref[a]);at=abg(tag);tf=ts(tag);
  16. for(var i=tag.length;i--;){if(at(i)){tmp[n++]=tf(i);}}
  17. } tmp.forEach(function(s){s.backgroundColor='#ecf2ea';});tmp=null;
  18. };
  19. addEventListener('load',confBackg,false);