Intercept Alerts and Enable Debugging

Ticket booking bot with timing and CSP bypass

  1. // ==UserScript==
  2. // @name Intercept Alerts and Enable Debugging
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description Ticket booking bot with timing and CSP bypass
  6. // @author Scott
  7. // @match *://*/*
  8. // @grant GM_xmlhttpRequest
  9. // @connect localhost
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. // 覆盖原生 alert 函数
  18. window.alert = function(message) {
  19. console.log("Intercepted alert: ", message);
  20. // 在控制台输出信息,而不弹出窗口
  21. };
  22.  
  23. // 覆盖原生 confirm 函数
  24. window.confirm = function(message) {
  25. console.log("Intercepted confirm: ", message);
  26. return true; // 自动返回 true,模拟用户确认
  27. };
  28.  
  29. // 覆盖原生 prompt 函数
  30. window.prompt = function(message, defaultResponse) {
  31. console.log("Intercepted prompt: ", message);
  32. return defaultResponse; // 自动返回默认响应
  33. };
  34.  
  35. // 监控并显示 JavaScript 错误
  36. window.onerror = function(message, source, lineno, colno, error) {
  37. console.error("Error caught: ", message, " at ", lineno, ":", colno);
  38. // 可以在此处添加更多的处理逻辑
  39. };
  40.  
  41. // 允许在调试时继续使用 F12
  42. document.addEventListener('keydown', function(event) {
  43. if (event.ctrlKey && event.key === 'u') {
  44. event.preventDefault(); // 防止 Ctrl + U 操作
  45. }
  46. });
  47.  
  48. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址