Skip to content

Instantly share code, notes, and snippets.

@masaakif
Created January 6, 2009 07:29
Show Gist options
  • Save masaakif/43714 to your computer and use it in GitHub Desktop.
Save masaakif/43714 to your computer and use it in GitHub Desktop.
add_favicon_for_2chbbsreader.user.js
// ==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