geckodriver
geckodriver copied to clipboard
Back/Forward should traverse history via the top-level browsing context
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:
- The browsing context has already been closed
- The browsing context is going to be destroyed
- 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.
We should certainly consider bfcache.