Javascript that detects Firebug?

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

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

7条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 13:14

    Currently, the window.console.firebug has been removed by latest firebug version. because firebug is an extension based JavaScript debugger, Which defined some new function or object in window.console. So most times, you can only use this new defined functions to detection the running status of firebug.

    such as

    if(console.assert(1) === '_firebugIgnore') alert("firebug is running!"); 
    if((console.log+'''').indexOf('return Function.apply.call(x.log, x, arguments);') !== -1)  alert("firebug is running!");
    

    You may test these approach in each firebug.

    Best wishes!

提交回复
热议问题