Skip to content

Instantly share code, notes, and snippets.

@uu59
Created October 5, 2011 02:18
Show Gist options
  • Save uu59/1263464 to your computer and use it in GitHub Desktop.
Save uu59/1263464 to your computer and use it in GitHub Desktop.
// ==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