There are 2 previous versions of this script.
// ==UserScript==
// @name YouTube Thumbnails
// @namespace http://userscripts.org/users/23652
// @description Adds a link to show the video's thumbnails, in hq if possible
// @include http://*.youtube.com/watch*v=*
// @include http://youtube.com/watch*v=*
// @copyright JoeSimmons
// @version 1.0.2
// @license Creative Commons Attribution-Noncommercial 3.0 United States License
// ==/UserScript==
// addGlobalStyle
function addGlobalStyle(css) {
if(typeof GM_addStyle=='function') GM_addStyle(css);
else if((head=document.getElementsByTagName('head')[0])) {
var style = document.createElement('style');
style.setAttribute('type', 'text/css');
style.innerHTML=css;
head.appendChild(style);
}
}
addGlobalStyle('#thumbnails_dropdown img {max-width:'+Math.floor(window.innerWidth/3-6)+'px;}');
function toggle() {
var e = document.getElementById('thumbnails_dropdown');
if(e) e.style.display = (e.style.display=='none') ? '' : 'none';
}
var title = document.getElementById('watch-vid-title'),
dropdown = window.document.createElement('div'),
a = window.document.createElement('a'),
id = window.location.href.split("v=")[1].split("&")[0],
pre = 'http://i2.ytimg.com/vi/';
a.textContent = 'Show/Hide Thumbnails';
a.setAttribute('href', 'javascript:void(0);');
a.setAttribute('style', 'font-size:14px; font-family:tahoma; color:#007CB9; text-decoration:underline overline;');
a.addEventListener('click', toggle, false);
dropdown.setAttribute('id', 'thumbnails_dropdown');
dropdown.setAttribute('style', 'display:none;');
dropdown.addEventListener('click', toggle, false);
dropdown.innerHTML = "<img src=\""+pre+id+"/hq1.jpg\"><img src=\""+pre+id+"/hq2.jpg\"><img src=\""+pre+id+"/hq3.jpg\">";
document.body.insertBefore(dropdown, document.body.firstChild);
title.setAttribute('style', 'font-size: 14px; font-family: Tahoma; margin-top:4px;');
title.appendChild(a);