FrancescoSTL / Site-Sonar

A browser extension which silently crowd-sources ad performance as you browse. Let's put an end to bad ads.
http://site-sonar.com
Mozilla Public License 2.0
9 stars 2 forks source link

Issue #5 - Automate Navigation #6

Closed FrancescoSTL closed 8 years ago

FrancescoSTL commented 8 years ago

Ref: #5

I'm thinking that it would be best to introduce this add-on with auto navigation in order to standardize our data among a group of domains. That said, this issue sucks. Attempting to determine when page assets are completely loaded has shown to be fairly difficult. We can't simply use timers either, as this will cause problems when users have varied connection speeds.

Additionally, HTTP requests can continue to be made as the user interacts with the page, so determining the event horizon from which we can say "this page has loaded" is a bit ambiguous.

OnLoad != All Assets Received WebRequest.OnCompleted != All Assets Received (tabs.updated status==='completed') != All Assets Received

The current method is using WebRequest.OnCompleted as mentioned above to determine when we should stop listening for onSendHeaders and simply wait foronHeadersRecieved for each request sent. This seems to be severely limiting the number of requests we're capturing as noted in Issue #5 because WebRequest.OnCompleted is firing too quickly. On attempting implementation of OnLoad and (tabs.updated status==='completed') above, the same result is given. As stated previously, mitigating this with a timer wouldn't work.

Solution? Might be giving up on automation and simply collecting the information that flows in before a user navigates away. TBD.

FrancescoSTL commented 8 years ago

After speaking with some other folks about this, it appears that the industry standard for benchmarking is sleeping a process for n-time, which won't be feasible for us on a large enough user base. For that reason, I'll be closing this issue for now and pursuing a silent add-on which benchmarks and processes data in the background while users browse.

FrancescoSTL commented 8 years ago

On second thought, it may be worth reopening this and implementing a sleep timer of ~30 seconds just for testing purposes. The feature is already 90% built, so we I may as well, just in case it is needed eventually. I'll leave this closed until the time comes to build the latter 10%.