Forked from masaakif/add_favicon_for_2chbbsreader.user.js
Created
August 7, 2017 00:11
-
-
Save rwilkes/2472d113896114ac8af9c4d0d898a435 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