Created
January 6, 2009 07:29
-
-
Save masaakif/43714 to your computer and use it in GitHub Desktop.
add_favicon_for_2chbbsreader.user.js
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
// ==UserScript== | |
// @name Add favicon for bbs2chreader | |
// @namespace http://gist.github.com/43714 | |
// @include http://127.0.0.1:8823/thread/http* | |
// ==/UserScript== | |
var AddFavicon = { | |
execute: function() { | |
var header = document.evaluate("//head/link", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; | |
if (header) { | |
var favicon1 = document.createElement('link'); | |
favicon1.setAttribute('rel','shortcut icon'); | |
favicon1.setAttribute('href','http://www2.2ch.net/favicon.ico'); | |
favicon1.setAttribute('type','image/vnd.microsoft.icon'); | |
header.parentNode.insertBefore(favicon1, header); | |
var favicon2 = document.createElement('link'); | |
favicon2.setAttribute('rel','icon'); | |
favicon2.setAttribute('href','http://www2.2ch.net/favicon.ico'); | |
favicon2.setAttribute('type','image/vnd.microsoft.icon'); | |
header.parentNode.insertBefore(favicon2, header); | |
} | |
}, | |
}; | |
AddFavicon.execute(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment