awalgarg / netmonitor

A Chrome extension which shows background network activity of web pages after they are loaded.
https://chrome.google.com/webstore/detail/netmonitor/jekcpjegemgakiacfgiplacomhabclce
393 stars 17 forks source link

Counter keeps on updating on URL Change or Page Refresh #4

Open blueelvis opened 8 years ago

blueelvis commented 8 years ago

The counter keeps on increasing even if the page is refreshed or I visit a different site in the same tab. This should be changed since it easily provides wrong information after few visits to different websites on a single tab.

This can be achieved by maintaining an array of size 2. Once the URL is changed, check the URL of both the elements of the array, if it is same, increase counter, else reset it.

This should also help in cases of web applications like github which perform most of the things in a single page.

What say?

awalgarg commented 8 years ago

This was actually intended to be "fixed" in the first release itself. There is some code at https://github.com/awalGarg/netmonitor/commit/33a58fcaeb5713413be7ba7da44ae6c88e8d580d#diff-efc121c246b20be70407018ef0f2b4b2R45 and https://github.com/awalGarg/netmonitor/commit/33a58fcaeb5713413be7ba7da44ae6c88e8d580d#diff-efc121c246b20be70407018ef0f2b4b2R26 which should make this to work properly. For some reason it doesn't work most of the times - it worked only 1 out 20 times or so in my tests. Also there are some other technical limitations in the chrome api to get this "right".

Marking this as a bug - this is definitely something I'd like to fix ASAP.