Greasy Fork

Greasy Fork is available in English.

weihl_test

open one's eyes to see the world.

当前为 2024-10-14 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         weihl_test
// @namespace    http://tampermonkey.net/
// @version      V0.1
// @description  open one's eyes to see the world.
// @author       weihule
// @match        https://pmos.sd.sgcc.com.cn:18080/trade/main/index.do*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=google.com
// @grant        none
// @license      AGPL-3.0
// ==/UserScript==

(function() {
    'use strict';
    window.addEventListener('load', function() {
        alert('Hello World');

        // 查找并切换到特定的 iframe
        const iframe = document.querySelector("iframe[@class='body-iframe']");
        if (iframe) {
            iframe.contentWindow.document.body;
        }
        console.log('0000000000000000000000000000 看这里');

        // 模拟等待时间
        setTimeout(() => {
            // 查找弹窗元素
            const popupWindow = document.querySelector("//div[@id='logModal']//div[@class='modal-dialog modal-lg']");
            if (popupWindow) {
                // 找到关闭按钮
                const closeButton = popupWindow.querySelector(".//div[@class='modal-header']/button[@class='close']");
                if (closeButton) {
                    closeButton.click();
                }
            }
        }, 10000); // 等待 10 秒,可根据实际情况调整等待时间
    });
})();