Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rwilkes/2472d113896114ac8af9c4d0d898a435 to your computer and use it in GitHub Desktop.
Save rwilkes/2472d113896114ac8af9c4d0d898a435 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