yunfile_auto_click

enter something useful

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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);
}