TBMarsi

taobao Shopping Cart Assistant.

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         TBMarsi
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  taobao Shopping Cart Assistant.
// @author       March
// @match        https://cart.taobao.com/*
// @match        https://buy.tmall.com/order/confirm_order.htm*
// @icon         https://www.taobao.com/favicon.ico
// @grant        none
// @run-at       document-end
// @license      MIT
// ==/UserScript==

(function() {
    var domain = window.location.host;
    switch(domain){
        case "cart.taobao.com":
            setTimeout(function(){
                var allSelect=document.querySelector('#J_SelectAll1');
                setTimeout(function(){allSelect.click()},100);
                var isClicked=false;
                window.setInterval(function(){
                    if(isClicked==true)return;
                    var refreshHours = new Date().getHours();
                    var refreshMin = new Date().getMinutes();
                    var refreshSec = new Date().getSeconds();
                    if(refreshHours=='14' && refreshMin=='0' && refreshSec=='1'){
                        var jGo=document.querySelector('#J_Go');
                        jGo.click();
                        isClicked=true;
                    }
                }, 100);
            }, 3000);
            break;
        case "buy.tmall.com":
            var clicked=false;
            setInterval(function(){
                if(clicked==true)return;
                var submit=document.querySelector('.go-btn');
                if(submit!=null){
                    submit.click();
                    clicked=true;
                }
            },100);
            break;
    }

})();