Closed Bug 1693252 Opened 4 years ago Closed 2 years ago

Sometimes "WebDriver:NavigateTo" returns for "about:blank" instead of target URL

Categories

(Remote Protocol :: Marionette, defect, P3)

Default
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: whimboo, Unassigned)

References

Details

Some navigations in Marionette do not end-up at the target page but on about:blank:

[task 2021-02-16T22:59:54.463Z] 22:59:54     INFO - PID 1474 | 1613516394461	webdriver::server	DEBUG	-> POST /session/6333f3f7-ce0b-4921-9a0b-fa843fd4ee75/url {"url": "http://web-platform.test:8000/common/blank.html"}
[task 2021-02-16T22:59:54.467Z] 22:59:54     INFO - PID 1474 | 1613516394466	Marionette	DEBUG	0 -> [0,4,"WebDriver:Navigate",{"url":"http://web-platform.test:8000/common/blank.html"}]
[task 2021-02-16T22:59:54.535Z] 22:59:54     INFO - PID 1474 | DEBUG: Adding blocker ScriptPreloader: Saving bytecode cache for phase xpcom-will-shutdown
[task 2021-02-16T22:59:54.540Z] 22:59:54     INFO - PID 1474 | [CodeCoverage] Setting handlers for process 1787.
[task 2021-02-16T22:59:54.623Z] 22:59:54     INFO - PID 1474 | DEBUG: Adding blocker content-prefs.sqlite#0: waiting for shutdown for phase Sqlite.jsm: wait until all connections are closed
[task 2021-02-16T22:59:54.625Z] 22:59:54     INFO - PID 1474 | DEBUG: Adding blocker Closing ContentPrefService2 connection. for phase Sqlite.jsm: wait until all clients have completed their task
[task 2021-02-16T22:59:54.629Z] 22:59:54     INFO - PID 1474 | DEBUG: Adding blocker Transaction (0) for phase content-prefs.sqlite#0: waiting for clients
[task 2021-02-16T22:59:54.645Z] 22:59:54     INFO - PID 1474 | 1613516394643	Marionette	TRACE	[17] MarionetteCommands actor created for window id 6
[task 2021-02-16T22:59:54.659Z] 22:59:54     INFO - PID 1474 | 1613516394656	Marionette	TRACE	[17] MarionetteEvents actor created for window id 6
[task 2021-02-16T22:59:54.702Z] 22:59:54     INFO - PID 1474 | 1613516394700	Marionette	TRACE	[17] MarionetteEvents actor created for window id 2147483649
[task 2021-02-16T22:59:54.705Z] 22:59:54     INFO - PID 1474 | 1613516394703	Marionette	TRACE	Received event pagehide for about:blank
[task 2021-02-16T22:59:54.732Z] 22:59:54     INFO - PID 1474 | 1613516394730	Marionette	TRACE	Received event DOMContentLoaded for about:blank
[task 2021-02-16T22:59:54.734Z] 22:59:54     INFO - PID 1474 | 1613516394731	Marionette	TRACE	Received event pageshow for about:blank
[task 2021-02-16T22:59:54.739Z] 22:59:54     INFO - PID 1474 | 1613516394732	Marionette	DEBUG	0 <- [1,4,null,{"value":null}]
[task 2021-02-16T22:59:54.756Z] 22:59:54     INFO - PID 1474 | 1613516394753	webdriver::server	DEBUG	<- 200 OK {"value":null}
Blocks: 1633972
Blocks: 1692949

Bug 1692949 actually shows a perfect example. So the first navigation indeed goes to about:blank with readyState equal to complete for the pageshow event. But then a moment later another navigation takes place to the actually requested URL. Note that no new tab get opened here.

Nika, do you have any idea? I'm happy to provide more details if required, but I would have to know what to listen or check for. Thanks!

Flags: needinfo?(nika)

I think we had discussed this a few days ago in #fission on matrix, and it's likely that this is being caused by your actor observing the creation of the initial about:blank document within a new process during a process switch. Moving the NavigateTo logic to using web progress listeners in the parent process might help avoid issues like that.

Flags: needinfo?(nika)

We had a similar thing to solve recently for CDP and the document.isInitialDocument flag was kinda helpful. We could improve our navigation logic by that without having to completely refactor it for web progress listener support.

But recently I haven't seen failures for this particular behavior. So it's nothing we would have to work on right now.

I haven't seen any occurrence of that recently anymore. Most likely it was fixed with all the refactoring of the navigation handling by using the WebProgressListener.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.