Skip to content

Instantly share code, notes, and snippets.

@venj
Created March 20, 2011 15:12
Show Gist options
  • Save venj/878367 to your computer and use it in GitHub Desktop.
Save venj/878367 to your computer and use it in GitHub Desktop.
Fully fixed the error in non-IE browsers to enable torrent download. You know how to install greasemonkey scripts. ;)
// ==UserScript==
// @name Fix download
// @namespace http://venj.me/greasemonkey/
// @description Fix an error in non-IE browsers.
// @include http://www.downloadindex.info/Get.asp?Id=*
function secBoard2(n) {
return function () {
var mainTable = document.getElementById("mainTable");
var secTable = document.getElementById("secTable");
for(i=0;i<secTable.tBodies[0].rows[0].cells.length;i++)
secTable.tBodies[0].rows[0].cells[i].className="sec1";
secTable.tBodies[0].rows[0].cells[n].className="sec2";
for(i=0;i<mainTable.tBodies.length;i++)
mainTable.tBodies[i].style.display="none";
mainTable.tBodies[n].style.display="block";
};
}
var secTable = document.getElementById("secTable");
for(i=0;i<secTable.tBodies[0].rows[0].cells.length;i++) {
var cell = secTable.tBodies[0].rows[0].cells[i];
cell.addEventListener("click",secBoard2(i), false);
}
// ==/UserScript==
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment