Firebug Lite

From FirebugWiki

(Difference between revisions)
Jump to: navigation, search
m (Static on-line installation: Changed from single quotes to double quotes)
(Commands: Added exceptions to command support and note about string substitution. Minor formatting improvements.)
Line 53: Line 53:
== Commands ==
== Commands ==
-
<em>Now FBLite supports [http://getfirebug.com/console.html all basic commands] of Firebug.</em>
+
Firebug Lite supports [http://getfirebug.com/console.html all basic commands] of Firebug except <code>console.assert</code> and <code>console.groupCollapsed</code>.
-
firebug.watchXHR: Use this function to watch the status of XmlHttpRequest objects.
+
Firebug Lite does not support string substitution patterns, it simply concatenates arguments together.
-
<pre class="code">
+
 
 +
 
 +
<code>firebug.watchXHR</code>: Use this function to watch the status of XmlHttpRequest objects.
 +
<pre>
var req = new XmlHttpRequest;
var req = new XmlHttpRequest;
firebug.watchXHR(req);</pre>
firebug.watchXHR(req);</pre>
-
firebug.inspect: Now elements can be inspected in javascript code:
+
<code>firebug.inspect</code>: Now elements can be inspected in javascript code:
-
<pre class="code">
+
<pre>
firebug.inspect(document.body.firstChild);
firebug.inspect(document.body.firstChild);
</pre>
</pre>
On some browsers, the console object is already declared. If you observe errors in Safari, for instance, use the console commands in this fashion:
On some browsers, the console object is already declared. If you observe errors in Safari, for instance, use the console commands in this fashion:
-
<pre class="code">
+
<pre>
firebug.d.console.cmd.log("test");
firebug.d.console.cmd.log("test");
-
firebug.d.console.cmd.dir([ "test" ]);</pre>
+
firebug.d.console.cmd.dir([ "test" ]);
 +
</pre>
== Notes ==
== Notes ==

Revision as of 01:56, 3 December 2009

Fb lite screenshot 1.png

Firebug is an extension for Firefox, but what happens 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 that are not named "Firefox".

Firebug Lite creates the variable "firebug" and doesn't affect or interfere with HTML elements that aren't created by itself.

Latest Version: 1.2.1 (2008-09 CHANGELOG)

Contents

Screenshots

Installing Firebug Lite 1.2

Static on-line installation

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

<script type="text/javascript" src="http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js"></script>

Firebug Lite as bookmarklet

With the following JS link you can use Firebug Lite on any page (you can copy it to create a bookmark):

  
javascript:var%20firebug=document.createElement('script');firebug.setAttribute('src','http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js');document.body.appendChild(firebug);(function(){if(window.firebug.version){firebug.init();}else{setTimeout(arguments.callee);}})();void(firebug);

Static off-line installation

Download the source Import firebug-lite-compressed.js or firebug-lite.js into your site's directory. Find "firebug-lite.css" URL on the javascript file which you imported and replace this with offline address of firebug-lite.css file.

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

Configuring Firebug Lite

Height of the firebug lite form is resizeable in latest version;

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

Also, developers can use their own css file;

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

Commands

Firebug Lite supports all basic commands of Firebug except console.assert and console.groupCollapsed.

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


firebug.watchXHR: Use this function to watch the status of XmlHttpRequest objects.

var req = new XmlHttpRequest;
firebug.watchXHR(req);

firebug.inspect: Now elements can be inspected in javascript code:

firebug.inspect(document.body.firstChild);

On some browsers, the console object is already declared. If you observe errors in Safari, for instance, use the console commands in this fashion:

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

Notes

On some browsers, the console object is already declared. If you observe errors in Safari, for instance, use the console commands in this fashion:

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

Firebug Lite creates the variables "firebug" and doesn't affect or interfere HTML elements that aren't created by itself.

Personal tools