Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix wait in networkIdle when event already fired
We need to try to recalculate the `Frame`'s lifecycle when we receive a `networkIdle` cdp event. In complex cases, the other lifecycle events have fired quite early on in the loading of the page, but the network is still busy which delays the `networkIdle` (and more importantly) the `EventFrameStoppedLoading` event. The hope is that once we do receive the `networkIdle` event, we can assume that `EventFrameStoppedLoading` has also been received, which means that the Frame is in the correct state and is ready to be recalculated, which in turn will fire off the internal `networkidle` events. Previously we relied on `DOMContentLoaded` to have been received at the same time as `networkIdle` so the Frame would have been in the correct state and the recalculate would have taken into account the `networkidle` state.
- Loading branch information