Changing Background of webpages Automatically.

When I surf i am always annoyed with web pages with white background. I hate web pages with high contrast white colors .So i thought about changing the white background of web pages automatically to my desired color .This tutorial is for those who don’t like white and other high contrast light colors as backgrounds on WebPages. White color causes eye stain and also monitor consumes more power when displaying white color. Even if you don’t feel anything your eyes and brain are working more.
The advantage of this java script is that it will change white colored background of all WebPages, and also preserve WebPages with comfortable colors as it is .

This is done in Firefox with "GraseMonkey" addon & greasemonkey script
For this you must be using Firefox Browser

1. First Install greasemonkey addon for firefox ,Greasemonkey

2. You need a greasemonkey script to change color automatically
Greasemonkey script

The default color change in this script is from white to light grey, You can choose your required color by editing the script (for e.g. to black).
For this once it is installed , go to Tools>GreaseMonkey>ManageUserScript,now you can see your installed script on the left that is "FFFFFF to EBEBEB" select this and click edit, for the first time it will ask for text editor, select your text editor(notepad).
Now in the last line of the script you can see the color in hex code

everything[i].style.backgroundColor = "#EBEBEB"; <-- this one #EBEBEB it is light gray You can change this to black or anything you want by replacing #EBEBEB with hex code of other colores, changing to #000000 will result in black colored google. Refer here for other colors hex code in this chart or 500 colors

If you also want to change the font color you will need to add extra code to do this.
Add this code( blue) after the earlier line you saw ( pink)that is… everything[i].style.backgroundColor = "#EBEBEB"; <----- add after this line

var font_tags=document.getElementsByTagName("font");
for(var i=0; i
font_tags[i].color = "#AAAAAA";
}

Save and exit your editor, now google will appear as black with font color as gray if your code is correct.
White font on black background may be uncomfortable so use gray font.
black = "#000000"
gray = "#AAAAAA"
or use gray as background ("#AAAAAA") with default font color,which i think is easy on eyes than black page.

You can add more webpages to this script, eg thinkdigit.forum for this u will need to duplicate "else if" statement as given below with rgb color like this.These values 238, 240, 242 & 245, 247, 249 is were script looks for white colored pages,this value is that of thinkdigit.forum which is not pure white.You can pick color of webpages in rgb by using colorzilla addon for firefox .
Add this code after the first "if clause".


else if(
bgcolor[i] == "rgb(238, 240, 242)" ||
bgcolor[i] == "rgb(245, 247, 249)"
)
{
everything[i].style.backgroundColor = "#AAAAAA";


If you only need to change color of only one particular webpage you can use another excellent firefox add-on called Platypus
which will allow u to customize a webpage in any way you want and will allow these changes to save as a GreaseMonkey script.

You can download a script that i modified Download

Note: This java script will not change backgrounds of some CSS styles webpages and also white images in the page.

0 comments: