tencent cloud studio, retry boot

Finds a button, waits 3 seconds, clicks it, and stops.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         tencent cloud studio, retry boot
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Finds a button, waits 3 seconds, clicks it, and stops.
// @author       You
// @match        https://ide.cloud.tencent.com/ws/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // 定义要查找的按钮选择器
    const BUTTON_SELECTOR = 'button.btn__21_ID';

    // 设置一个定时器,每 1 秒检查一次
    const checkInterval = setInterval(() => {
        // 尝试查找页面上的按钮
        const button = document.querySelector(BUTTON_SELECTOR);

        // 如果找到了按钮
        if (button) {
            console.log('按钮已找到!等待 3 秒后点击...');
            // 立即停止定时器,避免重复查找
            clearInterval(checkInterval);

            // 设置一个 3 秒的延迟,然后执行点击操作
            setTimeout(() => {
                console.log('3 秒已到,正在模拟点击按钮...');
                button.click();
                console.log('任务完成!');
            }, 3000); // 3000 毫秒 = 3 秒
        } else {
            console.log('按钮未找到,继续等待...');
        }
    }, 1000); // 1000 毫秒 = 1 秒
})();