NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name TorlockOptimizer // @namespace TorlockOptimizer // @include http://www.torlock.com/* // @version 2.1 // @grant none // ==/UserScript== var liens = document.querySelectorAll("a[href^='/torrent/']"); var number, ligne, a; liens.forEach(function(lien){ ligne = lien.parentNode.parentNode; a = ligne.querySelector(".lien-direct"); if(!a){ number = /[0-9]{7,}/.exec(lien.href)[0]; a = document.createElement("a"); a.classList.add("lien-direct"); a.href="/tor/"+number+".torrent"; a.innerHTML = '<img src="https://l.xxcdn.pw/dlbutton36690436.png" alt="">'; a.querySelector("img").style.height = "2em"; //a.style.float = "right"; ligne.appendChild(a); } }); var mainInput = document.querySelector("input[name='q']"); if(mainInput){ mainInput.focus(); mainInput.value = location.href.replace(/.*\/([^\/]*).html$/,"$1").replace(/-/g," "); document.body.addEventListener("keyup",function(e){ if(e.target.tagName != "INPUT"){ //Toujours en majuscule if(String.fromCharCode(e.keyCode) == "F"){ mainInput.focus(); } } }); }