您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
enter something useful
// ==UserScript== // @name TNTVillage autodownload torrent file // @namespace http://forum.tntvillage.scambioetico.org/ // @version 0.2 // @description enter something useful // @author Agostino Zanutto // @match http://forum.tntvillage.scambioetico.org/index.php?showtopic=* // @grant unsafeWindow // ==/UserScript== var jQuery = unsafeWindow.jQuery; console.log('INIT TntVillage autodownload'); all_a = unsafeWindow.document.getElementsByTagName("a"); for (var i = 0; i < all_a.length; i++) { var a = all_a[i]; var href = a.href; if (a.innerText !== '' && href.search(/act=Attach&/i) > 0) { console.log ('LINK FOUND: ' + a.innerText + ' => ' + href); console.log ('DOWNLOAD IT'); unsafeWindow.open(href); body=unsafeWindow.document.getElementsByTagName('body'); if (body.len == 1) { body[0].innerHTML='<h1>DOWNLOADED <a href="'+href+'">'+a.innerText+'<br/><a href="#" onclick="window.close();">CLOSE WINDOW</a>'; } unsafeWindow.setTimeout('window.close();',100); } }