ipleak 自动刷新

维护个鸡脖,刷新看看。自动刷新 ipleak.net 页面当显示 "Under maintenance" 时,Auto Refresh ipleak.net When Under Maintenance

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         ipleak 自动刷新
// @namespace    https://greasyfork.org/users/1171320
// @version      0.11
// @description  维护个鸡脖,刷新看看。自动刷新 ipleak.net 页面当显示 "Under maintenance" 时,Auto Refresh ipleak.net When Under Maintenance
// @author       yzcjd
// @author2     Lama AI 辅助瞎写
// @match        https://ipleak.net/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // 定义刷新间隔时间(以毫秒为单位),这里设置为 1 秒
    const REFRESH_INTERVAL = 1000;

    // 检查页面内容是否显示 "Under maintenance" 或 "维护中"
    function checkMaintenance() {
        const bodyText = document.body.innerText || ""; // 获取页面正文内容
        if (bodyText.includes("Under maintenance") || bodyText.includes("维护中")) {
            console.log("检测到页面显示维护信息,将在 " + REFRESH_INTERVAL / 1000 + " 秒后刷新...");
            setTimeout(() => {
                location.reload(); // 刷新页面
            }, REFRESH_INTERVAL);
        }
    }

    // 页面加载完成后立即检查
    checkMaintenance();
})();