This browser extension described here (https://www.youtube.com/watch?v=hMb3PN6iLTU) has to run on all websites, and often has to work out if it should move on to the next part of the guide or not. Part of the way it has to do this is by trying to detect if the page is 'loading' or not.
Unfortunately as most sites now use 'ajax' we can't use the default event listener for page loading. As such, one way you could solve it would be to detect for when elements of the page imply that the page is loading (for instance a loading notification with text or a loading gif).
--> Try to write some code which is given a callback, and tries to detect for ajax calls (using detection or another method).
If the page doesn't appear to be loading, then call the callback, if it does then wait until it has finished (then call it once). We recommend taking longer than an hour but less than 4 hours on this challenge (thinking of edge cases), and trying to think about false positives, the goal is a piece of JS we could copy and paste onto any website and works in the majority of cases.
Example Code used to call:
callWhenReadyToGo(callback); //Callback is a function that is called once when ready.
Onload and readyState only work for page loads, not for Ajax calls.
Less than 30 hrs/week
Less than 1 month< 1 monthProject LengthDuration
I am looking for a mix of experience and value