Background colour changer

By Doug Barrett Last update Jul 5, 2009 — Installed 417 times. Daily Installs: 0, 4, 3, 0, 3, 2, 5, 2, 2, 1, 4, 0, 4, 2, 1, 0, 0, 3, 4, 0, 3, 5, 1, 10, 5, 3, 1, 2, 2, 4, 2, 0

There are 2 previous versions of this script.

// ==UserScript==
// @name      Background colour changer                 
// @namespace      Doug Barrett
// @include        http://*
// ==/UserScript==

var setprefs = function() {

if(GM_getValue("page_colour")==="undefined")
{
GM_setValue("page_colour", "#FFFFFF");
}

var setcolour = prompt("Page Background Colour:", GM_getValue("page_colour"));
GM_setValue("page_colour", setcolour);

if(confirm("Do you want this colour for all pages?"))
{
GM_setValue("page_colour_boolean", "true")
} else
{
GM_setValue("page_colour_boolean", "false");
}

document.body.style.background = setcolour;
}

if(GM_getValue("page_colour_boolean")==="true")
{
document.body.style.background = GM_getValue("page_colour");
}

GM_registerMenuCommand("Set background colour", setprefs);