zoukankan      html  css  js  c++  java
  • 分享知识-快乐自己:前端页面设置禁止非法修改

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
        <script>
            // 反调试函数,参数:开关,执行代码
            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>
    </head>
    <body>
        <h1>你可以看见吗?</h1>
        <script type="text/javascript">
            endebug(false, function () {
                // 非法调试执行的代码(不要使用控制台输出的提醒)
                document.write("检测到非法调试,请关闭后刷新重试!");
            });
        </script>
    </body>
    </html>
  • 相关阅读:
    模板方法模式
    LINQ多条件OR模糊查询
    在LINQ中实现多条件联合主键LEFT JOIN
    js只显示整点
    Vue-cli2中处理跨域
    vue动态绑定类(实现tab)
    Vue中引入cdn同时防止cdn挂掉
    vue+nginx开启gzip压缩
    Vue路由守卫
    vue-router嵌套路由和二级目录(域名)
  • 原文地址:https://www.cnblogs.com/mlq2017/p/10305820.html
Copyright © 2011-2022 走看看