开发者

How does the Firebug network monitor work?

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?


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜