Created
December 16, 2011 01:30
-
-
Save makimoto/1483984 to your computer and use it in GitHub Desktop.
favicon from Jenkins' status
This file contains 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
// ==UserScript== | |
// @name Jenkins status favicon | |
// @namespace http://www.xn--n8j4d9b.com/ | |
// @include http://url_to_your_jenkins | |
// ==/UserScript== | |
var favicon = document.createElement('link'); | |
favicon.rel = 'shortcut icon'; | |
favicon.type = 'image/gif'; | |
var img = document.getElementsByClassName('icon32x32')[0] | |
if(img == undefined) { | |
if((img = document.getElementsByClassName('build-row')[0]) != undefined){ | |
img = img.getElementsByTagName('img')[0] | |
} | |
} | |
if(img != undefined) { | |
favicon.href = img.src; | |
document.head.appendChild(favicon); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment