Closed Bug 1775141 Opened 2 years ago Closed 2 years ago

Live "browsingContext.contextCreated" events have to be sent out with an URL of "about:blank"

Categories

(Remote Protocol :: WebDriver BiDi, defect, P1)

defect
Points:
2

Tracking

(firefox-esr102 fixed, firefox104 fixed)

RESOLVED FIXED
104 Branch
Tracking Status
firefox-esr102 --- fixed
firefox104 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [webdriver:m4][webdriver:relnote])

Attachments

(1 file)

Sometimes the browsingContext.contextCreated event isn't getting sent out for the target URL but for about:blank:

https://treeherder.mozilla.org/logviewer?job_id=381897529&repo=mozilla-esr102&lineNumber=4549-4568

[task 2022-06-20T12:44:01.897Z] 12:44:01     INFO - PID 3796 | 1655729041895	RemoteAgent	TRACE	[30] ProgressListener state=start: http://web-platform.test:8000/webdriver/tests/support/inline.py?doc=%3C%21doctype+html%3E%0A%3Cmeta+charset%3DUTF-8%3E%0A%3Ci ... 53Cdiv%253Ebar%253C%252Fdiv%253E%26mime%3Dtext%252Fhtml%26charset%3DUTF-8%27%3E%3C%2Fiframe%3E&mime=text%2Fhtml&charset=UTF-8
[task 2022-06-20T12:44:03.262Z] 12:44:03     INFO - PID 3796 | 1655729043276	Marionette	TRACE	Remoteness change detected. Set new top-level browsing context to 45
[task 2022-06-20T12:44:03.290Z] 12:44:03     INFO - PID 3796 | 1655729043301	RemoteAgent	TRACE	Received command browsingContext._applySessionData for destination WINDOW_GLOBAL
[task 2022-06-20T12:44:03.304Z] 12:44:03     INFO - PID 3796 | 1655729043302	RemoteAgent	TRACE	Module windowglobal/browsingContext.jsm found for WINDOW_GLOBAL
[task 2022-06-20T12:44:03.304Z] 12:44:03     INFO - PID 3796 | 1655729043302	RemoteAgent	TRACE	Created MessageHandler WINDOW_GLOBAL for session 142ee9d9-4747-40a4-b17d-6ef4d99374eb
[task 2022-06-20T12:44:03.317Z] 12:44:03     INFO - PID 3796 | 1655729043317	RemoteAgent	TRACE	Received command browsingContext._applySessionData for destination WINDOW_GLOBAL
[task 2022-06-20T12:44:03.318Z] 12:44:03     INFO - PID 3796 | 1655729043318	RemoteAgent	TRACE	Module windowglobal/browsingContext.jsm found for WINDOW_GLOBAL
[task 2022-06-20T12:44:03.319Z] 12:44:03     INFO - PID 3796 | 1655729043318	RemoteAgent	TRACE	Created MessageHandler WINDOW_GLOBAL for session 142ee9d9-4747-40a4-b17d-6ef4d99374eb
[task 2022-06-20T12:44:03.320Z] 12:44:03     INFO - PID 3796 | 1655729043319	RemoteAgent	TRACE	MessageHandler WINDOW_GLOBAL for session 142ee9d9-4747-40a4-b17d-6ef4d99374eb is being destroyed
[task 2022-06-20T12:44:03.320Z] 12:44:03     INFO - PID 3796 | 1655729043319	RemoteAgent	TRACE	Unregistered MessageHandler WINDOW_GLOBAL for session 142ee9d9-4747-40a4-b17d-6ef4d99374eb
[task 2022-06-20T12:44:03.332Z] 12:44:03     INFO - PID 3796 | 1655729043332	RemoteAgent	TRACE	Received command browsingContext._applySessionData for destination WINDOW_GLOBAL
[task 2022-06-20T12:44:03.333Z] 12:44:03     INFO - PID 3796 | 1655729043333	RemoteAgent	TRACE	Module windowglobal/browsingContext.jsm found for WINDOW_GLOBAL
[task 2022-06-20T12:44:03.334Z] 12:44:03     INFO - PID 3796 | 1655729043333	RemoteAgent	TRACE	Created MessageHandler WINDOW_GLOBAL for session 142ee9d9-4747-40a4-b17d-6ef4d99374eb
[task 2022-06-20T12:44:03.338Z] 12:44:03     INFO - PID 3796 | 1655729043338	RemoteAgent	TRACE	Received command browsingContext._applySessionData for destination WINDOW_GLOBAL
[task 2022-06-20T12:44:03.339Z] 12:44:03     INFO - PID 3796 | 1655729043339	RemoteAgent	TRACE	Module windowglobal/browsingContext.jsm found for WINDOW_GLOBAL
[task 2022-06-20T12:44:03.339Z] 12:44:03     INFO - PID 3796 | 1655729043339	RemoteAgent	TRACE	Created MessageHandler WINDOW_GLOBAL for session 142ee9d9-4747-40a4-b17d-6ef4d99374eb
[task 2022-06-20T12:44:03.542Z] 12:44:03     INFO - PID 3796 | 1655729043543	RemoteAgent	TRACE	[17179869185] No navigation detected: http://web-platform.test:8000/webdriver/tests/support/inline.py?doc=%3C%21doctype+html%3E%0A%3Cmeta+charset%3DUTF-8%3E%0A%3Cdiv%3Efoo%3C%2Fdiv%3E&mime=text%2Fhtml&charset=UTF-8
[task 2022-06-20T12:44:03.546Z] 12:44:03     INFO - PID 3796 | 1655729043544	WebDriver BiDi	DEBUG	142ee9d9-4747-40a4-b17d-6ef4d99374eb <- {"method":"browsingContext.contextCreated","params":{"context":"17179869185","url":"http://web-platform.test:8000/webdriver/t ... %0A%3Cdiv%3Efoo%3C%2Fdiv%3E&mime=text%2Fhtml&charset=UTF-8","children":null,"parent":"575939b1-726c-4cfb-9f1e-efc87d6ae293"}}
[task 2022-06-20T12:44:03.546Z] 12:44:03     INFO - PID 3796 | 1655729043544	RemoteAgent	TRACE	[17179869186] No navigation detected: about:blank
[task 2022-06-20T12:44:03.547Z] 12:44:03     INFO - PID 3796 | 1655729043545	WebDriver BiDi	DEBUG	142ee9d9-4747-40a4-b17d-6ef4d99374eb <- {"method":"browsingContext.contextCreated","params":{"context":"17179869186","url":"about:blank","children":null,"parent":"575939b1-726c-4cfb-9f1e-efc87d6ae293"}}

The question here is why the frame isn't getting loaded. Maybe it's related to bug 1760291 and wptserve fails to send the data here again? Nevertheless the timeout that we have here for this debug build is probably too short as well and as such we abort waiting for an initial navigation.

See also a discussion about the removal of the URL field:
https://github.com/w3c/webdriver-bidi/issues/220

Blocks: 1775095
Severity: -- → S3
Priority: -- → P3

Live events (when a new browsing context is actually created) should actually always be sent out immediately. That means that no navigation has actually be taken place and as such the URL should always be about:blank.

Putting bug back for triage so that we might at least have it as P2.

Severity: S3 → --
Priority: P3 → --
Summary: "browsingContext.contextCreated" events for frames are sometimes send out for "about:blank" → Live "browsingContext.contextCreated" events have to be sent out with an URL of "about:blank"

This is blocked on the wdspec test updates which will be synced via bug 1777173.

Depends on: 1777173
No longer depends on: 1760291
Points: --- → 2
Priority: -- → P1
Whiteboard: [webdriver:m4]

The severity field is not set for this bug.
:whimboo, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(hskupin)
Severity: -- → S3
Flags: needinfo?(hskupin)
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/15370340d339 [webdriver-bidi] Send live "browsingContext.contextCreated" events with "about:blank" as URL. r=webdriver-reviewers,jdescottes
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
Depends on: 1779198

Comment on attachment 9284599 [details]
Bug 1775141 - [webdriver-bidi] Send live "browsingContext.contextCreated" events with "about:blank" as URL.

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: The WebDriver BiDi specification has been updated and this patch fixes an intermittent failure as well that we would also like to see fixed on 102ESR which will still exist for quite some time.

With uplifting this also needs the patch on bug 1777173 uplifted before.

  • User impact if declined: The browsingContext.contextCreated event will be delayed and most of the times emits the target URL of the newly opened tab within the payload but not about:blank. As such intermittent unexpected behavior can occur.
  • Fix Landed on Version: 104
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): There is a low risk because the code that awaits the new tab to be finished with the initial navigation has only been removed.
Attachment #9284599 - Flags: approval-mozilla-esr102?

Comment on attachment 9284599 [details]
Bug 1775141 - [webdriver-bidi] Send live "browsingContext.contextCreated" events with "about:blank" as URL.

This doesn't graft cleanly to ESR102. Please rebase and re-request when you get a chance.

Attachment #9284599 - Flags: approval-mozilla-esr102?

I rebased the patches and pushed to try:
https://treeherder.mozilla.org/jobs?repo=try&revision=b26b8360449cb4eae9f3e9cddea07e44a84a4664

Please note that for the 102 branch I had to slightly modify the manifest file for bug 1777173 because our script.evaluate implementation isn't available there yet and as such both tests that open a new browsing context via window.open will still pass.

Julian, can you please check if the updated patches look fine to you? Thanks.

Flags: needinfo?(jdescottes)

Thanks Henrik, the rebased patches all look correct to me.

Flags: needinfo?(jdescottes)

Comment on attachment 9284599 [details]
Bug 1775141 - [webdriver-bidi] Send live "browsingContext.contextCreated" events with "about:blank" as URL.

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: The WebDriver BiDi specification has been updated and this patch fixes an intermittent failure as well that we would also like to see fixed on 102ESR which will still exist for quite some time.

For uplifting the three changesets from the following try build have to be used:

https://treeherder.mozilla.org/jobs?repo=try&revision=b26b8360449cb4eae9f3e9cddea07e44a84a4664 which include the changes from bug 1777173 as well.

  • User impact if declined: The browsingContext.contextCreated event will be delayed and most of the times emits the target URL of the newly opened tab within the payload but not about:blank. As such intermittent unexpected behavior can occur.
  • Fix Landed on Version: 104
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): There is a low risk because the code that awaits the new tab to be finished with the initial navigation has only been removed.
Attachment #9284599 - Flags: approval-mozilla-esr102?

Comment on attachment 9284599 [details]
Bug 1775141 - [webdriver-bidi] Send live "browsingContext.contextCreated" events with "about:blank" as URL.

Approved for 102.2esr.

Attachment #9284599 - Flags: approval-mozilla-esr102? → approval-mozilla-esr102+
Whiteboard: [webdriver:m4] → [webdriver:m4][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: