抖店订单页面自动刷新

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

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

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

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

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

您需要先安装一款用户脚本管理器扩展,例如 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);
    }

})();