tencent cloud studio, retry boot

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

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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 秒
})();