分享一段检测开发者工具的代码,有点意思 - V2EX
LukeChien

分享一段检测开发者工具的代码,有点意思

  •  
  •   LukeChien Aug 2, 2018 5016 views
    This topic created in 2844 days ago, the information mentioned may be changed or developed.

    偶然在一个网站看到的,打开开发者工具会自动在 debugger 那行中断执行,这思路不错

    var check = (function () { var callbacks = [], timeLimit = 50, open = false; setInterval(loop, 1); return { addListener: function (fn) { callbacks.push(fn); }, cancleListenr: function (fn) { callbacks = callbacks.filter(function (v) { return v !== fn; }); } } function loop() { var startTime = new Date(); debugger; if (new Date() - startTime > timeLimit) { if (!open) { callbacks.forEach(function (fn) { fn.call(null); }); } open = true; window.stop(); alert('没事别老研究人家接口了,好好做站去吧'); } else { open = false; } } })(); check.addListener(function () { window.location.reload(); }); 
    9 replies    2018-08-07 15:56:03 +08:00
    TomatoYuyuko
        1
    TomatoYuyuko  
       Aug 2, 2018
    太菜了没看明白 有大佬解释下吗_(:°з」∠)_
    LukeChien
        2
    LukeChien  
    OP
       Aug 2, 2018
    APP 换行错乱,截个图
    ![微信截图_20180802142117.png]( https://i.loli.net/2018/08/02/5b62a384e6c94.png)
    FanWall
        3
    FanWall  
       Aug 2, 2018 via Android
    @TomatoYuyuko 打开开发者工具后,代码会在 debugger 处断下,一般手动跳过也会超过 50ms 的 timeLimit
    kslr
        4
    kslr  
       Aug 2, 2018
    简单阿,ctrl+f8
    shyrock
        5
    shyrock  
       Aug 2, 2018
    学习,等解释。
    adjusted
        6
    adjusted  
       Aug 2, 2018
    想到以前 fb 直接把开发工具给禁用的新闻,特意找了一下 https://stackoverflow.com/questions/21692646/how-does-facebook-disable-the-browsers-integrated-developer-tools
    a342191555
        7
    a342191555  
       Aug 2, 2018
    想起来之前一个介绍爬虫的文章 [商标局网请收下我的膝盖-反爬与反反爬的奇技淫巧]( https://zhuanlan.zhihu.com/p/29196829)

    ```Javascript
    for (var i = 1; i < 99999; i++)
    window.clearInterval(i);
    ```
    cydysm
        8
    cydysm  
       Aug 6, 2018
    我前两天也看到了 www.juduoba.com
    stainsun
        9
    stainsun  
       Aug 7, 2018
    程序员的幽默,哈哈。
    '没事别老研究人家接口了,好好做站去吧'.gif
    About     Help     Advertise     Blog     API     FAQ     Solana     1585 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 62ms UTC 16:43 PVG 00:43 LAX 09:43 JFK 12:43
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86