Firebug Lite

From FirebugWiki
Revision as of 20:01, 2 December 2009 by Brianpeiris (Talk | contribs) (Updated version to reflect code and changelog. Reworded some text for clarity and correctness. Added more exceptions to console API. Corrected watchXHR example. Removed duplicated notes.)

Jump to: navigation, search
Fb lite screenshot 1.png

Firebug is an extension for Firefox but what do you do when you need to test your pages in Internet Explorer, Opera and Safari?

The solution is Firebug Lite, a JavaScript file you can insert into your pages to simulate some Firebug features in browsers other than Firefox.

Firebug Lite creates two variables, firebug and console, in the global context and does not affect or interfere with HTML elements that aren't created by itself.

Latest Version: 1.2.3 (2009-05 ChangeLog)


Installing Firebug Lite

Static on-line installation

Insert this line of code into any page that you want to contain Firebug Lite:

<script type="text/javascript" src=""></script>

Firebug Lite as a bookmarklet

Enter the following code into your address bar to use Firebug Lite on any page. You can also copy the code into a bookmark on your toolbar.


Static off-line installation

Download the source files and save them to a folder in your site's directory. Include firebug-lite-compressed.js or firebug-lite.js in the page(s) that you want to contain Firebug Lite. Search for "firebug-lite.css" in the JavaScript file and replace it with the location of the firebug-lite.css file you downloaded.

<script language="javascript" type="text/javascript" src="/path/to/firebug/firebug-lite.js"></script>

Configuring Firebug Lite

You can change the height of the Firebug Lite UI with the following code.

<script type="text/javascript">
firebug.env.height = 500;

You can also use your own CSS file to customize Firebug Lite's UI:

<script type="text/javascript">
firebug.env.css = "/myown/firebug.css"

Firebug Lite API


Firebug Lite supports all of Firebug's basic console methods except console.assert,, console.groupCollapsed, console.groupEnd, console.profile and console.profileEnd.

Firebug Lite does not support string substitution patterns, it simply concatenates arguments together.


Use this method to watch the status of XmlHttpRequest objects.

var request = new XMLHttpRequest();

firebug.watchXHR(request);'GET', '', false);   


Use this method to inspect DOM elements.



Some browsers already declare the console variable. If you observe errors in Safari, for instance, use the console commands in this fashion:

firebug.d.console.cmd.dir([ "test" ]);