nicovideo Add Thumbnail

By gifnksm Last update Jun 13, 2008 — Installed 1,180 times. Daily Installs: 2, 1, 2, 0, 3, 7, 4, 4, 5, 4, 4, 3, 6, 3, 4, 2, 2, 5, 2, 3, 5, 2, 6, 4, 2, 3, 2, 2, 2, 2, 4, 2
// ==UserScript==
// @name           nicovideo Add Thumbnail
// @namespace      http://d.hatena.ne.jp/gifnksm/
// @description    Add Thumbnail at nicovideo's watch page.
// @include        http://www.nicovideo.jp/watch/*
// ==/UserScript==

const image_id = "GM_nicovideo_add_thumbnail";
var image = document.createElement('img');
image.src = unsafeWindow.Video.thumbnail;
image.id = image_id;
image.alt = "";

GM_addStyle("\
    img#"+image_id+" {\
        width: 26px;\
        height: 20px;\
        margin-right: 5px;\
        vertical-align: middle;\
    }\
    img#"+image_id+":hover {\
        width: 130px;\
        height: 100px;\
        position: relative;\
        margin: -40px -99px -40px 0px;\
    }\
");
var h1 = document.getElementsByTagName("h1")[0];
h1.insertBefore(image, h1.firstChild);