chromewhip icon indicating copy to clipboard operation
chromewhip copied to clipboard

Page.navigate + trigger on Page.frameStoppedLoading event is not reliable

Open chazkii opened this issue 8 years ago • 1 comments
trafficstars

Reason is that the frameId changes between the ack and relevant event. This is not how I interpreted the devtools protocol docs https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-navigate

Have filed a bug with Chromium to confirm this: https://bugs.chromium.org/p/chromium/issues/detail?id=747224

chazkii avatar Jul 21 '17 04:07 chazkii

Extended the low-level driver in 7a10b2c to allow for an input event to be the id source for the trigger event, and now the go method uses the Page.frameNavigated event as the id source. Manually tested this to work.

This approach isn't as robust as relying on the command ack payload (if it contained the correct frameId) but given that each tab has it's own context, and it is unlikely to send concurrent go commands to the tab, waiting for the first Page.frameNavigated event works as intended.

chazkii avatar Jul 24 '17 01:07 chazkii