Skip to content

Instantly share code, notes, and snippets.

@makimoto
Created December 16, 2011 01:30
Show Gist options
  • Save makimoto/1483984 to your computer and use it in GitHub Desktop.
Save makimoto/1483984 to your computer and use it in GitHub Desktop.
favicon from Jenkins' status
// ==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