Greasy Fork

Greasy Fork is available in English.

禁用无限调试脚本debugger

2023/9/6 13:10:29

目前为 2023-09-06 提交的版本。查看 最新版本

// ==UserScript==
// @name        禁用无限调试脚本debugger
// @namespace   debugger
// @match       *://*.keloop.cn/*
// @match       *://*.pingyike.com/*
// @grant       none
// @version     1.0
// @author      enjoysala
// @description 2023/9/6 13:10:29
// @license MIT
// ==/UserScript==
(function () {
  const setInterval = window.setInterval;
  window.setInterval = function(fun, time) {
    // console.log(time, 'ddddd', fun.toString());
    if (fun && fun.toString) {
      var funString = fun.toString();
      if (funString.indexOf('debugger') > -1) return;
      if (funString.indexOf('window.close') > -1) return;
    }

    return setInterval(fun, time);
  }
})()