A couple of ways for detecting Firebug

firebugI think probably all web developers (even some designes) already know Firebug, otherwise it is a must-have tool you can’t miss.

Anyway, this post is about detecting if the user has Firebug active, and which version is using. Básically the first technique is just looking if there exists a DIV whose identifier is _firebugConsole, and then check the  FirebugVersion in order to get the version.

Following javascript code (using jQuery) detects wether firebug is active or not, and shows an alert with the running version:

if ($("#_firebugConsole").length) {
alert ("Firebug version " + $("#_firebugConsole").attr ("FirebugVersion") + " is active");
}

Converting previous code to any other javascript framework is really easy, even you can use document.getElementById.

The other way for detecting Firebug is checking wether window.console.firebug has been defined:

if (window.console && window.console.firebug) {
alert ("Firebug is active");
}

Trackback URL

  1. visita mi pagina
    07/03/2009 at 3:05 pm Permalink

    Gracias por la información!

  2. khela
    23/02/2010 at 4:53 am Permalink

    With Mootools i do this simply with:

    if($defined(console.firebug))

  3. Pau Sánchez
    25/02/2010 at 8:06 am Permalink

    @khela really simple way with mootools
    Thanks for sharing!