Created
October 5, 2011 02:18
-
-
Save uu59/1263464 to your computer and use it in GitHub Desktop.
This file contains 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 display nicovideo movie thumbnail on watch page | |
// @namespace http://uu59.org/ | |
// @version 1.0.0 | |
// @include http://www.nicovideo.jp/watch/* | |
// ==/UserScript== | |
(function(){ | |
var addCss = function(css){ | |
var head = document.querySelector("head") | |
var style = document.createElement("style"); | |
head.appendChild(style); | |
style.type = "text/css"; | |
style.appendChild(document.createTextNode(css)); | |
} | |
var id = document.querySelector('link[rel="canonical"]').href.match(/sm([0-9]+)/) | |
if(!id) return; | |
var id = id[1]; | |
var thumburl = "http://tn-skr.smilevideo.jp/smile?i="+id; | |
var info = document.getElementById("itab_description"); | |
addCss('#itab_description:after {' + | |
'content: ""; display: block; clear:both;' + | |
'}' | |
); | |
info.innerHTML = '<p style="float:right;"><img src="'+thumburl+'" /></p>'+ | |
info.innerHTML | |
; | |
; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment