User Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.30 Safari/536.5
Steps to reproduce:
Install bookmarktlet from http://kaaes.github.com/timing/
Go to webpage (to keep it simple) http://www.mozilla.org/robots.txt
Click on bookmarktlet => all is good!
Wait 5 seconds on page and reload (CTRL+F5, ENTER in url bar)
Click on bookmarktlet => wait time on the page is added to Navigation Timing (fetchStart)
Page spent on the page should not be added to Navigation Timing
See behaviour in Google Chrome.
These numbers are sent to Google Analytics, and it is there that I viewed strange numbers first. (https://groups.google.com/a/googleproductforums.com/d/topic/analytics/IdxoGvoSDzM/discussion)
Error in my description
*Time* spent on the page should not be added to Navigation Timing.
created video to try to explain the issue better!
The developer of the 'bookmarklet' confirmed it's a bug in firefox and not in her code!
Olli, Igor, how is this stuff supposed to work, exactly? It looks to me like we're not tracking on the docshell's timing object which channel its doing timing for, which we probably should...
Looking at nsDocShell::InternalLoad, a similar issue would arise if a beforeunload handler disallowed leaving the page. We'd record the navigationStart at the point before running that handler, and then if we managed to leave the page sometime use _that_ navigationStart...
But I still think the right design for the timing stuff would have it know which exact channel it's doing timing for....
Created attachment 626317 [details] [diff] [review]
This could really use a test, but testing timing stuff is a PITA. :(
Is there a browser version of firefox in wich we can test the solution?
Any nightly, for now. In a few days, also Aurora.
OK, thanks, I tested it and it works great!
Now I discovered a new bug!