• 请不要在回答技术问题时复制粘贴 AI 生成的内容
zjsxwc
V2EX  ›  程序员

前端这种不让别人使用 devtools 调试是如何做到的?

  •  
  •   zjsxwc ·
    zjsxwc · Dec 20, 2018 · 2089 views
    This topic created in 2732 days ago, the information mentioned may be changed or developed.

    http://www.nicetool.net/app/wangsicong.html

    我想打开浏览器 devtools 改下这个页面的 html,但是貌似改不了,他是怎么做到的?有什么黑魔法?

    RH
        1
    RH  
       Dec 20, 2018
    会一直调用 console.clear 方法吧
    zjsxwc
        2
    zjsxwc  
    OP
       Dec 20, 2018
    结贴:

    油猴脚本 加一句
    ```
    devtoolsDetector = function () {}
    ```

    就可以破解
    vishva
        3
    vishva  
       Dec 20, 2018
    日志级别改一下,屏蔽掉输出,简单粗暴.以上
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1069 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 23:19 · PVG 07:19 · LAX 16:19 · JFK 19:19
    ♥ Do have faith in what you're doing.