There are 13 previous versions of this script.
// ==UserScript==
// @name YouTubed Already
// @namespace none
// @include http://www.youtube.com/*
// ==/UserScript==
// script to highlight visited links which youtube prevents for some mysterious reason
(function(){ //this serves as a wrapper to create a private, unnamed namespace
//strip featured video links of this non-essential param (&feature=fvw)
//so we can see if we've been there before (added 8/23/10):
var vidlist
vidlist = document.getElementsByTagName("a")
for( i = 0; i <vidlist.length; i++) {
if(vidlist[i].href.indexOf("watch?v=") > 0) {
if(vidlist[i].href.indexOf("&feature=") > 0) {
vidlist[i].href = vidlist[i].href.substr(vidlist[i].href,vidlist[i].href.indexOf("&feature="))
}}
//else break
}
// highlight visited video links sitewide:
GM_addStyle('.video-entry a:visited { color:red !important; } ');
// again for "Most Popular" section:
GM_addStyle('.title a:visited { color:red !important; } ');
GM_addStyle('.video-title a:visited { color:red !important;}');
//ads-description section of search screen:
GM_addStyle('.ads-description a:visited { color:red !important; padding-left: 18px; background: url(http://s.ytimg.com/yt/favicon-vfl86270.ico) left no-repeat;}');
//class used on "view all comments" screen:
GM_addStyle('.vtitle a:visited { color:red !important; padding-left: 18px; background: url(http://s.ytimg.com/yt/favicon-vfl86270.ico) left no-repeat;}');
// for added emphasis, place the youtube favicon in front of each visited link
GM_addStyle('.video-mini-title a:visited{ padding-left: 18px; background: url(http://s.ytimg.com/yt/favicon-vfl86270.ico) left no-repeat; } ');
GM_addStyle('.video-short-title a:visited{ padding-left: 18px; background: url(http://s.ytimg.com/yt/favicon-vfl86270.ico) left no-repeat; } ');
GM_addStyle('.video-long-title a:visited { padding-left: 18px; background: url(http://s.ytimg.com/yt/favicon-vfl86270.ico) left no-repeat; } ');
GM_addStyle('.video-title a:visited { padding-left: 18px; background: url(http://s.ytimg.com/yt/favicon-vfl86270.ico) left no-repeat; } ');
//added 8/23/10 to highlight the entire block with red background, favicon placed on right:
GM_addStyle('.video-list-item a:visited { background: url(http://s.ytimg.com/yt/favicon-vfl86270.ico) right no-repeat; background-color: #FFAAAA} ');
// for search results page, make entire block have a gray background:
page = new String(document.URL)
if(page.indexOf("results?")>0) {
alldivs = document.getElementsByTagName("div");
for( var i = 0; i < alldivs.length; i++ ) {
if( alldivs[i].className == 'video-entry')
if( alldivs[i].innerHTML.indexOf("Previously viewed") >0) {
alldivs[i].style.backgroundColor = "#DDDDDD;";
}
}
}
})(); // end of anonymous function
// the () causes immediate execution of the containing anonymous function