geckodriver icon indicating copy to clipboard operation
geckodriver copied to clipboard

Back/Forward should traverse history via the top-level browsing context

Open whimboo opened this issue 3 years ago • 1 comments

In step 1 of the Back and Forward commands the top-level browsing context is checked, but in step 3 the traversal happens in the current browsing context. That means the navigation will fail if the currently selected frame got destroyed.

https://w3c.github.io/webdriver/#back

Also it should be made clear in step 4 which browsing context needs to be observed. Situations to take into account:

  1. The browsing context has already been closed
  2. The browsing context is going to be destroyed
  3. The browsing context is going to be moved into bfcache (supported by Firefox and Safari for now)

For the situation 3) there will be a pagehide event but no pageshow until another navigation brings the page / frame back out of the bfcache. It means current implementations would hang.

CC'ing @AutomatedTester and @jgraham for further feedback. Shall we take bfcache into account for the WebDriver spec? If yes it might warrant a new issue / discussion for sure.

whimboo avatar Oct 27 '20 15:10 whimboo

We should certainly consider bfcache.

jgraham avatar Oct 27 '20 15:10 jgraham