8
votes

In the Firebug add-on for Firefox, how is Firebug able to get the connecting, waiting, and receiving time? Also, how is it that Firebug can know the file size before the file is even finished loading?

Is JavaScript used in these calculations, or does Firebug use another method altogether?

2
This is a very good question, I've the same doubt now! Could not found what is exactly the "Connecting" on Network-tab. I'll look on the source-code to find something.rafa.ferreira

2 Answers

5
votes

Firebug plugs into Firefox and can fetch data from there. The webserver maybe sends a Content-Length HTTP header, so this is the expected size of the downloaded file. Firefox puts all resources to load into a queue while parsing the website. The time from putting an item into the queue until it is fetched can be considered "waiting time". The HTTP fetch engine from Firefox can give information about how long a connect() to the server takes.

So to put a long story short, I believe Firefox has an API so that extensions can fetch information like that from the engine.

1
votes

Firebug is most, if not all, JavaScript.

If you're truly interested, you can find the network monitor related bits and pieces here in the Firebug source tree.