Created
February 22, 2015 12:47
-
-
Save ShingoFukuyama/e9c1652c1dfbc87cc3a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Ohajiki Web Browser | |
* ユーザースクリプト (読み込み後) に設定 | |
* Google検索をするたびに背景の色をランダムに変える | |
*/ | |
(function(d){ | |
function randomColor() { | |
var letters = '0123456789ABCDEF'.split(''); | |
var color = '#'; | |
for (var i = 0; i < 6; i++ ) { | |
color += letters[Math.floor(Math.random() * 16)]; | |
} | |
return color; | |
} | |
if (location.href.match(/.*\.google\..+?\/search/)) { | |
d.body.style.backgroundColor = randomColor(); | |
} | |
})(document); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment