抖店订单页面自动刷新

Add a refresh button to the top-left corner and automatically click a specified element every 10 seconds.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         抖店订单页面自动刷新
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Add a refresh button to the top-left corner and automatically click a specified element every 10 seconds.
// @author       itsAnstar
// @match        https://fxg.jinritemai.com/ffa/morder/order/list*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';


    function createRefreshButton() {
        const refreshButton = document.createElement('button');
        refreshButton.setAttribute('type', 'button');
        refreshButton.setAttribute('class', 'auxo-btn auxo-btn-dashed auxo-btn-sm');
        refreshButton.innerText = 'Refresh';
        refreshButton.style.position = 'fixed';
        refreshButton.style.top = '10px';
        refreshButton.style.left = '10px';
        refreshButton.addEventListener('click', handleClick);
        document.body.appendChild(refreshButton);
    }

    function handleClick() {
        const targetElement = document.querySelector('button.auxo-btn.auxo-btn-dashed.auxo-btn-sm');
        if (targetElement) {
            targetElement.click();
        }
    }

    function initScript() {
        createRefreshButton();


        setInterval(handleClick, 10000);
    }


    if (document.readyState === 'complete' || document.readyState === 'interactive') {
        initScript();
    } else {
        document.addEventListener('DOMContentLoaded', initScript);
    }

})();