yunfile_auto_click

enter something useful

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name       yunfile_auto_click
// @namespace  yunfile.com
// @version    0.1
// @description  enter something useful
// @include    *.yunfile.com/*
// @match      *.yunfile.com/*
// @copyright  2012+, You
// ==/UserScript==

if( document.getElementById('downbtn') ){
	var a = document.querySelectorAll('#downbtn a')
    for(var x in a){
		if ( a.hasOwnProperty(x) ) {
			if( a[x].innerHTML == '這裡下載' ){
				simulateClick(a[x])
				break;
			}
		}
    }
}

function simulateClick(e){
	e.nodeType || (e=e.length==1?e[0]:null);
	if( e )
	{
	  var Event;
	  Event = document.createEvent("MouseEvents");
	  Event.initEvent("mousedown", true, true);
	  e.dispatchEvent(Event);
	  Event = document.createEvent("MouseEvents");
	  Event.initEvent("click", true, true);
	  e.dispatchEvent(Event);
	  Event = document.createEvent("MouseEvents");
	  Event.initEvent("mouseup", true, true);
	  e.dispatchEvent(Event);
	}
}
var vcode = document.getElementById('vcode');
if( vcode ){
	var auto_wait = setInterval(function(){
		if( document.getElementById('showmsgdiv').css.display == 'block' ){
			setTimeout(function(){
				document.getElementById('showmsgdiv').css.display = 'none';
			},5000);
		}
		if( vcode.value.length == 4){
		  simulateClick( document.getElementById('slow_button') )
		}
	},30000);
}