views:

63

answers:

0

I hope you can help me with some code to monitor sent bytes (especially if a user is uploading a file in a web formular).

For my extension a have a new window(id=rootWnd) in which is my . What I want to add now is the possibility to monitor all the traffic that is sent on a single request on this browser only, especially if a user starts to upload a "big" file. I already tried to start an nsIHttpActivityObserver which works if I read the aExtraSizeData in observeActivity() but 1) it counts not only the uploading data (which would be ok if there is only one tab and while uploading no other request can be made) and 2) it counts all data even from the main firefox window, not only for my monitorbrowser.

I am still a beginner to all this XUL stuff and so a was happy to got the httpActivityServer to work, but for now it seems to me that perhaps the webProgessListener would have been the better solution... :-)

Can you help my with some rows of code to show how I can implement the webprogesslistener for my browser-element (id=monitorbrowser) and show the outgoing bytes ONLY for my browser-element and WHILE uploading (e.g. every 500kb oder ever 3 seconds on the console)

Or is there an other solution or a better way to monitor the sent traffic for a special browser-window in an extension only?

Thank you very much for your help!