Intercept Alerts and Enable Debugging

Ticket booking bot with timing and CSP bypass

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Intercept Alerts and Enable Debugging
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  Ticket booking bot with timing and CSP bypass
// @author       Scott
// @match        *://*/*
// @grant        GM_xmlhttpRequest
// @connect      localhost
// @license      MIT
// ==/UserScript==


(function() {
    'use strict';

    // 覆盖原生 alert 函数
    window.alert = function(message) {
        console.log("Intercepted alert: ", message);
        // 在控制台输出信息,而不弹出窗口
    };

    // 覆盖原生 confirm 函数
    window.confirm = function(message) {
        console.log("Intercepted confirm: ", message);
        return true; // 自动返回 true,模拟用户确认
    };

    // 覆盖原生 prompt 函数
    window.prompt = function(message, defaultResponse) {
        console.log("Intercepted prompt: ", message);
        return defaultResponse; // 自动返回默认响应
    };

    // 监控并显示 JavaScript 错误
    window.onerror = function(message, source, lineno, colno, error) {
        console.error("Error caught: ", message, " at ", lineno, ":", colno);
        // 可以在此处添加更多的处理逻辑
    };

    // 允许在调试时继续使用 F12
    document.addEventListener('keydown', function(event) {
        if (event.ctrlKey && event.key === 'u') {
            event.preventDefault(); // 防止 Ctrl + U 操作
        }
    });

})();