禁止使用 Firebug

作者:手气不错 发布时间:May 18, 2009 分类:奇技淫巧

相信没有人不知道 Firebug 是什么东西,但有时候我们糟糕的代码不想让同行轻松的使用 F12 就能一览无遗。

那么怎么办呢?

这里有个猥琐的办法帮你实现这个愿望

if( window.console && window.console.firebug ) {
    document.body.innerHTML = '';
}

如果还觉得不保险,那顺便连 F12 也禁止吧

document.onkeydown = function(e)  {
    if (123 == (e || {}).keyCode)  return false;
}

哦也,从此大家开始写垃圾代码吧,没人看我们代码喽

已有 26 条回复

  1. fireyy May 18th, 2009 at 08:34 pm #1
    fireyy

    firebug一直开启的话,是在是太耗内存了,总觉得他们的代码有内存侧漏

  2. fei May 18th, 2009 at 08:40 pm #2
    fei

    firebug爱好者泪目

  3. est May 18th, 2009 at 09:12 pm #3
    est

    修改firebug源代码中。。。。

    把DOM改成window.kongsole。哈哈。。。

    哦。对了。你还忘记禁用Ctrl+Shift+L了。

  4. dexbol May 18th, 2009 at 10:17 pm #4
    dexbol

    web developer -> Information -> View javascript
    不信手气不错会写出烂代码

  5. Lorz May 18th, 2009 at 10:49 pm #5
    Lorz

    貌似网页没加载完全的时候,不能 firebug 的

  6. liuzhongshu May 19th, 2009 at 09:03 am #6
    liuzhongshu

    用这个javascript的packer,http://dean.edwards.name/packer/,相信没人看的懂了。

  7. guest May 19th, 2009 at 09:22 am #7
    guest

    我马上报告firebug团队,让console名和热键全部可配置

  8. aw May 19th, 2009 at 10:07 am #8
    aw

    猥琐啊猥琐!!!!!~~~~

  9. aw May 19th, 2009 at 10:08 am #9
    aw

    @liuzhongshu

    八成不是看js而是看dom的……

  10. will May 19th, 2009 at 10:31 am #10
    will

    ....这个你都研究了!你很讲究!

  11. Showfom May 19th, 2009 at 10:40 am #11
    Showfom

    这方法……

  12. 摇光 May 19th, 2009 at 06:04 pm #12
    摇光

    其实我就是想学习的。

  13. feng May 20th, 2009 at 08:50 am #13
    feng

    下载你的代码到本地,慢慢看。。。

  14. magnfee May 20th, 2009 at 12:22 pm #14
    magnfee

    找的就是你这个招,就是不想让别人偷看code

  15. marshane May 20th, 2009 at 02:13 pm #15
    marshane

    @liuzhongshu 淘宝老是来这套!

    不知道 Chrome中怎么禁诶 呵呵?

  16. bigCat May 20th, 2009 at 03:02 pm #16
    bigCat

    - - 鄙视烂代码...
    本页第一个错误
    link rel="icon" type="image/x-icon" href="http://www.gracecode.com/images/favicon/favicon_16x16.png" type="image/png" /

  17. 龙子 May 21st, 2009 at 04:29 pm #17
    龙子

    够猥琐!

  18. xhlv May 25th, 2009 at 10:41 am #18
    xhlv

    果然很猥琐

  19. SunJian May 26th, 2009 at 01:55 pm #19
    SunJian

    open open open

  20. kingabird May 26th, 2009 at 11:12 pm #20
    kingabird

    这想法真是太淫荡了!!

  21. guoban May 28th, 2009 at 06:46 am #21
    guoban

    lz确认过代码工作吗?我在FF3.0.10+Firbug1.3.3下仍然可以通过鼠标点击firebug图标来看到body内容,随之F12禁用也被解除

  22. 桑拿院的小伙子 May 30th, 2009 at 09:52 am #22
    桑拿院的小伙子

    只要有心去看,办法多的是....

  23. c1g June 3rd, 2009 at 10:05 am #23
    c1g

    我ff2.0+firebug1.05下仍然可以看哦

  24. Veidy.lei June 30th, 2009 at 11:56 pm #24
    Veidy.lei

    太猥琐了,强烈鄙视。。

  25. PHP Blog | 让我们开始使用firefox July 7th, 2009 at 05:28 pm #25
    PHP Blog | 让我们开始使用firefox

    [...]这里还有有趣的:“有时候我们糟糕的代码不想让同行轻松的使用 F12 就能一览无遗”:http://www.gracecode.com/archives/2959/[...]

  26. yaya September 9th, 2009 at 12:27 pm #26
    yaya

    果然奇淫啊~

Yahoo 统计