Several posts already announced fresh new release of Firebug 1.5 (!) and so, let me focus on one new cool feature that comes with the combo Firebug 1.5 + Firecookie 1.0.

Firecookie is an extension to Firebug that allows managing cookies in your browser. Latest 1.0v has been also just released on AMO and it's fully compatible with Firebug 1.5.

Since Firebug 1.5, introduces a new Break on next feature (among other things) that can be used to break Javascript execution on various events (e.g. on XHR) fired by the current page, it was straightforward that this can be also useful for debugging cookies.

Read more...

Page load performance is largely important topic these days and virtually touches every web developer. In this post, I am going to show several page-load cases and describe how to properly read (analyze) data provided by the Net panel in Firebug.

Just to quickly summarize, the purpose of the Net panel is to intercept network communication between a web-page and the server and see what's going on under the hood. All created reports (logs) can be exported by NetExport extension (in HAR format) and there is also an online viewer allowing to preview all exported logs in graphical form.

In order to put together all following examples (HTTP activity logs) I used:
Firefox 3.6 + Firebug 1.5 + NetExport 0.7.

More...

Example 1: Simple Page Load

Let's start with a simple page load.

There are two requests in this log. Elapsed time to get the page document was 16 milliseconds and the load event (the red line) was fired in 58ms. Consequently a 5ms XHR was executed. The total elapsed time (from beginning of the first request till the end of the second/last request) is 408 ms. DOMContentLoaded event (the blue line) was fired in 46 ms.

See a tooltip with detailed timing info.

Example 2: Connection Limit

Each browser has a limit for number of simultaneous connections to the same server when downloading a page. If the limit is reached, other resources have to wait in an internal browser queue till a connection is released. See the following two page logs that show how the situation looks like if there is 8 different images on the page (each image takes ~2.5 sec to download).

#1 Cuzillion (max connections == 6)

  • The limit is 6 in Firefox 3.6 by default, so the first six images start downloading immediately after the page document is available (i.e. DOMContentLoaded event fired in Firefox).
  • The other two images have to wait till there is a free connection (yes, that's the light-brown phase).
  • Existing connections are reused, see there is no green (connection) phase for the last two requests.

#2 Cuzillion (max connections == 2)

  • The other log shows what happens if the limit is set to 2 (network.http.max-persistent-connections-per-server == 2). Notice that every image in this test takes ~2.3 sec to load.

This example comes from Cuzillion (made by Steve Souders).

Example 3: Pipelining

This example uses the same page as the previous example (#2) and compares what happens if pipelining is on.

You can see that using pipelining (network.http.pipelining == true) doesn't help in this case - the page actually takes more time to fire the load event. The first six images are again loaded using six different connection, but 7th and 8th image is downloaded using shared connection. It's not clear which connection is actually shared (there are no APIs that would allow Firebug to know), but it's clear that both last two images were downloaded using the same connection, which increased the total time.

Example 4: Persistent Connections

This test case shows impact of HTTP Connection header. This header is used to tell the server whether an existing connection should be closed or kept alive and wait for further requests (which is usually good optimization). See following log that depicts how it looks if the header is set to Keep-Alive (default in HTTP/1.1) or Close.

There are four requests to load the entire test-page. One for the initial page document and three executed by the page. The Connection header is manipulated for the three requests (file1.php, file2.php, file3.php).

#1 Test page (Connection: Keep-Alive)

  • The first page log shows that only one connection was created to download entire page. All three requests executed by the page reused the initial connection. You can see that there is only one green phase (+ a little bit for DNS lookup).

#2 Test page (Connection: close)

  • In the second log, there is a connection created to get the initial page document and this one is reused by the file1.php request. But as it was mentioned, these three requests use Connection: close request header and so, after file1.php, file2.php and file3.php the connection is closed and new one is must be created if there is a further request.

Example 5: Inline Scripts Block

It's not a secret that inline scripts block download of a page. Let's see following log that depicts how this looks from the network activity perspective.

#1 Cuzillion

  • Note the gap between 3td and 4th request. This is caused by a 5 sec inline script execution.

#2 Cuzillion

  • The second page log is showing what happens if the inline script is moved to the bottom of the page. Note that we have got a shorter loading time.

This example comes from Cuzillion.

Example 6: Redirects

This example shows how redirects looks like when reported by the Net panel.

#1 Final Page (one redirect)

  • The redirect is done by the server that has to figure out what is the target file. If the last / was added, the additional redirect wouldn't be necessary since the server knows that the URL points to a directory.

#2 Final Page (infinite redirection)

  • This scenario shows what happens if the redirect links to itself. In Firefox, the maximum number of redirection is limited to 20 (see network.http.redirection-limit preference)

I have already mentioned several times that the number of extensions for Firebug is unbelievable and still increasing. My guess is that there is currently about 40 extensions adding new features. And of course, this great to see!

Many of these extensions are creating new panels with various additional info, often related to the current web-page and the problem is that there is not enough horizontal space to display all the panel tabs at once. So, after installing enough number of extensions, the situation can look like as follows.

Too many tabs in Firebug

The screenshot clearly shows what happens if there is too many tabs. The search box is pushed off the screen and it's not possible to even see the other tabs...

Please help us to decide how to solve this problem!

Read more...

I have recently written some documentation about how to write automated tests for Firebug (possibly even for Firebug extensions) and also how to run an official Firebug test suite. Here is a quick summary and a few links.

Firebug Test Doc Home
Running Automated Test Suite
Test Examples
Test API

Running Automated Test Suite

Running the official test suite is as easy as installing Firebug and FBTest (Firebug) extension.

At some point (I hope in FB 1.6), the FBTest extension will be part of Firebug developer build (with an 'X' in the name) so, running tests should be even easier.

To execute all tests:

  1. Open Firebug Test Console. Pick menu Tools -> Firebug -> Open Test Console.
  2. Put http://getfirebug.com/tests/content/testlists/firebug1.5.html URL into the URL bar (should be there by default).
  3. Press Run All button on the toolbar.

There are some tests that require Firefox 3.6 so, the recommended configuration (to see all green) is:

  • Firefox 3.6
  • Firebug 1.5

Please let us know if you see failing tests.

Firebug 1.5 beta phase has started (about a month ago) and so, I would like to also summarize state of Firebug activation model (I wrote about how to enable and disable Firebug 1.2/1.4). This feature has been always a bit unconvincing and we have got a lot of feedback with various proposals how to do it differently.

Since there is many views on how the activation model should look like (from the user experience point of view) and these vary in the (UI) implementation, we have decided to create a Firebug extension Firestarter that extends Firebug's built-in activation model.

Distribute activation enhancements using such an extension is faster than waiting for new Firebug release and it can also be used as an incubator for better solutions.

Read more...

I have recently written a post about Break on Next feature (), introduced in Firebug 1.5 that allows breaking on various events occurring on a page. One of the examples I mentioned was XMLHttpRequest execution.

In this post I would like to describe another way how Firebug can be used to debug XHR. This time I want to focus on how to create XHR conditional breakpoints.

Read more...

We have made a great further progress with John J. Barton on a new extension for Firebug called Eventbug. Big thanks to Olli Pettay (smaug) for fixing #448602 + #506961 and providing new Firefox APIs that allow enumerating event listeners on a web page!

Notice that these APIs are available in Firefox 3.7a1pre (I hope they'll make it into 3.6) and you also need Firebug 1.5 to test it.

Update: all necessary APIs for Eventbug have been backported to Firefox 3.6b3pre.

This extension brings a new Events panel that lists all of the event handlers on the page grouped by event type. The panel also nicely integrates with other Firebug panels and allows to quickly find out, which HTML element is associated with specific event listener or see the Javascript source code.

So, see it in action!

Read more...

I have recently wrote several posts about new features introduced in Firebug 1.5 (so far beta 1 is available) and now I would like to describe another great feature called Break On Next (or simply Break On), which is also new in Firebug 1.5.

This feature extends the idea of breakpoints, which is one of the cornerstones of todays debugging tools and I believe that Break On Next brings a breath of fresh air to the world of debugging & breakpoints.

It's primary goal is breaking the Javascript execution at required place in the code that is unknown to the developer beforehand. The typical example, probably well known to most web developers is: "Where in the hell is the code, which is executed if I click this button?".

Let's see how Firebug can answer this question...

Read more...

I have been waiting for a long time to write about this great news. Since bug #488270 has been fixed in Firefox 3.6 (beta), Firebug 1.5 (beta) uses a new API to measure timing of underlying network activity more precisely.

Firebug now uses a component called http-activity-distributor that allows to register a listener and get notifications about various phases of each network request (DNS Lookup, connecting, sending, etc.). The most important thing is that one of the parameters passed to the listener is a time-stamp. This is something what was missing till now.

Having the time-stamp is critical since Javascript code (and Firebug is entirely implemented in Javascript) is executed on Firefox UI thread. In case when the UI is blocked by time expensive operation (e.g. DOM rendering, script execution, etc.) any event sent to a Javascript handler (and so, handled on the UI thread) can be delayed. So, getting the time-stamp withing JS handler can produce impaired time results.

Firebug Net panel now fixes this problem and the timing info is correct. See couple of examples I have analyzed when testing with a nice online tool called Cuzillion developed by Steve Souders.

Read more...

We have been working with Simon Perkins and Steve Souders on an open format for exporting HTTP tracing information. It's called HTTP Archive (HAR) and we have just finished spec v1.1.

The format is already supported by Firebug (with NetExport extension installed), HTTPWatch 6.2 and also DebugBar 5.3. Further tools like Show Slow and Cesium could be the next.

The key idea is to have a common format for archiving HTTP information that are captured by HTTP sniffers. These logs contain valuable info about page load performance and can be further used to analyze and optimize weaknesses of the monitored page.

There is already a few blog posts about this, explaining all details and so, let me just summarize the most important links here.

Links

HAR Specification

HAR Discussion Group (first post moderated)

HAR Viewer Online preview of *.har files.

NetExport Firebug Extension for exporting HTTP logs.

Recommended Firebug Configuration: Firebug 1.5a26+, NetExport 0.7b5

« Previous PageNext Page »