<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div>正确网页</div>
    <script>
      // 当打开了调试面板

      var debugflag = false;
      fuck(false, function () {
        document.write("检测到非法调试, 请关闭调试终端后刷新本页面重试!");
        document.write("<br/>");
        document.write("Welcome for People, Not Welcome for Machine!");
        debugflag = true;
      });

      ready(function () {
        if (!debugflag) {
          alert("欢迎")
        }
      });
      function ready(fn) {
        if (document.addEventListener) {
          document.addEventListener(
            "DOMContentLoaded",
            function () {
              document.removeEventListener(
                "DOMContentLoaded",
                arguments.callee,
                false
              );
              fn();
            },
            false
          );
        }
        // 如果IE
        else if (document.attachEvent) {
          // 确保当页面是在iframe中加载时,事件依旧会被安全触发
          document.attachEvent("onreadystatechange", function () {
            if (document.readyState == "complete") {
              document.detachEvent("onreadystatechange", arguments.callee);
              fn();
            }
          });
          // 如果是IE且页面不在iframe中时,轮询调用doScroll 方法检测DOM是否加载完毕
          if (
            document.documentElement.doScroll &&
            typeof window.frameElement === "undefined"
          ) {
            try {
              document.documentElement.doScroll("left");
            } catch (error) {
              return setTimeout(arguments.callee, 20);
            }
            fn();
          }
        }
      }
      function fuck(off, code) {
        check();
        endebug(off, code);
        document.onkeydown = function () {
          var e = window.event || arguments[0];
          if (e.keyCode == 123) {
            alert("检测到非法调试,F12被管理员禁用");
            return false;
          }
          if (e.ctrlKey && e.keyCode == 83) {
            alert("检测到非法调试,CTRL + S被管理员禁用");
            return false;
          }
        };
        document.oncontextmenu = function () {
          alert("检测到非法调试,右键被管理员禁用");
          return false;
        };
        function check() {
          try {
            !(function circle(r) {
              (1 !== ("" + r / r).length || 0 === r) &&
                function () {}.constructor("debugger")(),
                circle(++r);
            })(0);
          } catch (error) {
            setTimeout(check, 100);
          }
        }
        function endebug(off, code) {
          if (!off) {
            !(function (e) {
              function n(e) {
                function n() {
                  return u;
                }
                function o() {
                  window.Firebug &&
                  window.Firebug.chrome &&
                  window.Firebug.chrome.isInitialized
                    ? t("on")
                    : ((a = "off"), console.log(d), console.clear(), t(a));
                }
                function t(e) {
                  u !== e &&
                    ((u = e), "function" == typeof c.onchange && c.onchange(e));
                }
                function r() {
                  l ||
                    ((l = !0),
                    window.removeEventListener("resize", o),
                    clearInterval(f));
                }
                "function" == typeof e &&
                  (e = {
                    onchange: e,
                  });
                var i = (e = e || {}).delay || 500,
                  c = {};
                c.onchange = e.onchange;
                var a,
                  d = new Image();
                d.__defineGetter__("id", function () {
                  a = "on";
                });
                var u = "unknown";
                c.getStatus = n;
                var f = setInterval(o, i);
                window.addEventListener("resize", o);
                var l;
                return (c.free = r), c;
              }
              var o = o || {};
              (o.create = n),
                "function" == typeof define
                  ? (define.amd || define.cmd) &&
                    define(function () {
                      return o;
                    })
                  : "undefined" != typeof module && module.exports
                  ? (module.exports = o)
                  : (window.jdetects = o);
            })(),
              jdetects.create(function (e) {
                var a = 0;
                var n = setInterval(function () {
                  if ("on" == e) {
                    setTimeout(function () {
                      if (a == 0) {
                        a = 1;
                        setTimeout(code);
                      }
                    }, 200);
                  }
                }, 100);
              });
          }
        }
      }
    </script>
  </body>
</html>
最后修改:2021 年 02 月 26 日 07 : 28 PM
如果觉得我的文章对你有用,请随意赞赏