html icon indicating copy to clipboard operation
html copied to clipboard

Add navigation hooks for WebDriver BiDi history traversal

Open jgraham opened this issue 3 years ago • 3 comments

WebDriver BiDi wants to invoke the 'traverse the history by a delta` algorithm, and get a callback whenever the algoritihm has run to completion, either by failing or by the navigation or state restoration completing.

https://github.com/w3c/webdriver-bidi/pull/109 is the WebDriver BiDi side of this change.


/browsing-the-web.html ( diff ) /history.html ( diff ) /infrastructure.html ( diff )

jgraham avatar Jul 30 '21 20:07 jgraham

I'll review Monday (although can you try fixing the build first?).

Sadly this algorithm does not match browsers very well, but I imagine we can slot something in for now. /cc @jakearchibald as something to take into account when rewriting.

domenic avatar Jul 30 '21 22:07 domenic

@jgraham Can I help make progress on this somehow? It's blocking https://github.com/w3c/webdriver-bidi/pull/109, right?

foolip avatar Sep 14 '22 09:09 foolip

At this point, any work in this area should be done against the branch in #6315. Note that traversing can traverse multiple frames (and this is much more explicit in that branch), or maybe zero (if bfcache is not in effect and the server ends up with a 204/download). I imagine that might affect the "one callback, once" idea...

domenic avatar Sep 14 '22 16:09 domenic

https://github.com/whatwg/html/pull/6315 has been merged now so this could be rebased. @jgraham do you think you'll get a chance to do that? Happy to help if that would be... helpful.

foolip avatar Nov 25 '22 16:11 foolip

I tried to resolve conflicts, but everything except the first 2-line change to link definitions conflicts. I think the best approach is to go hook-by-hook and find the right place to invoke it in the new spec:

  • [ ] WebDriver BiDi navigation failed
  • [x] WebDriver BiDi page show
  • [x] WebDriver BiDi pop state
  • [x] WebDriver BiDi fragment navigated

foolip avatar Feb 23 '23 08:02 foolip

OK, I've put everything where I think it needs to be. I'll do a self-review to point out things I'd like feedback on.

foolip avatar Feb 23 '23 14:02 foolip

Looking some more at this, I'm not sure we we need to add additional callbacks. https://github.com/whatwg/html/pull/6315 did a lot of refactoring and it's now easier to follow whether a callback is always reached.

I spotted one error that I'm fixing in https://github.com/whatwg/html/pull/8939.

foolip avatar Feb 23 '23 14:02 foolip