// ==UserScript== // @version 1.0.0 // @name KickassTorrents + Yt + IMDb // @description add youtube popup and imdb rating to main movies page, this fixes the five fingers // @namespace https://greasyfork.org/users/3159 // @include http://kickass.so/movies/* // @include https://kickass.so/movies/* // @downloadURL none // ==/UserScript== //minus IMDb for now var box = document.getElementsByClassName('iaconbox'); var nlink = document.getElementsByClassName('cellMainLink'); var names = []; function fixTitle(title) { title = title.replace(/[()]/g, '').replace(/[.]/g, ' '); // remove unwanted characters title = title.replace(/([1|2][8|9|0][0-9]{2}).*/, '$1'); // trim after date return title; } for (i = 0; i < box.length; i++) { box[i].children[4] ? box[i].children[4].style.display = "none" : null; box[i].children[2] ? box[i].children[2].style.display = "none" : null; box[i].children[3] ? box[i].children[3].children[0].className += " partner1Button" : null; names.push(fixTitle(nlink[i].innerText)); } bg = document.createElement("div"); bg.style.cssText = "background:rgba(0, 0, 0,.8);position:fixed;top:0;z-index:9999;width:100%;height:100%;display:none"; bg.onclick = function () { bg.style.display = "none"; bg.innerHTML = ""; }; document.body.appendChild(bg); for (var i = 0; i < box.length; i++) { box[i].insertAdjacentHTML("beforeend", "Yt"); var x = encodeURIComponent(names[i]).replace(/%20/g, '+').replace(/'/g, '%27'); // replace space with plus and apostrophe with %27 eval("document.getElementsByClassName('yt')[i].onclick = function (){bg.style.display='block';bg.innerHTML=''};"); //autoplay isn't supported }