Javascript that detects Firebug?

前端 未结 7 1885
抹茶落季
抹茶落季 2020-11-27 12:47

What\'s a surefire way of detecting whether a user has Firebug enabled?

相关标签:
7条回答
  • 2020-11-27 13:35

    Keep in mind in Chrome window.console also returns true or [Object console].

    Furthermore, I would check whether Firebug is installed with

    if (window.console.firebug !== undefined) // firebug is installed

    Below is what I get in Safari and Chrome, no firebug installed.

    if (window.console.firebug) // true
    if (window.console.firebug == null) // true
    if (window.console.firebug === null) // false
    

    The Is-True and Is-Not Operators obviously do type coercion, which should be avoided in JavaScript.

    0 讨论(0)
提交回复
热议问题