Closed Bug 1869735 Opened 5 months ago Closed 5 months ago

Wrong context id for network events of iframe navigation requests

Categories

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

defect
Points:
2

Tracking

(firefox122 fixed)

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 4 open bugs)

Details

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

Attachments

(2 files)

STRs:

ER: The network events for the iframe navigation should be associated with the context id of the iframe
AR: The network events are using the parent window context id

Subsequent requests (eg favicon) done in the iframe will have the correct context id, the one from the iframe.

This means we get the wrong navigation id in those requests.

We also have the same issue when dynamically adding an iframe in a page, the initial request to create the iframe will be mapped to the parent's context id, which makes one puppeteer test fail (network Request.frame should work for subframe navigation request).

Hi Valentin,

See description above for more details, tldr channels created for an iframe navigation always seem "owned" by the iframe's parent context.

At the moment we are retrieving the BrowsingContext corresponding to a channel via channel.loadInfo.browsingContextID, and we are doing this when receiving the activity ACTIVITY_SUBTYPE_REQUEST_HEADER. I've also tried to look at the loadContext's associatedWindow or topFrameElement, but they are always set to the frame's parent.

Do you know if there is a way to link those channels to the BrowsingContext of the iframe being loaded/navigated?

Flags: needinfo?(moz.valentin)

Ah I see there is frameBrowsingContextID on the loadInfo, which seems to do exactly what I asked. Leaving the ni? in case you have some more insights, but looks like we have enough to fix it on our own.

I don't have any more info. I'm glad frameBrowsingContext gets you the information you need.

Flags: needinfo?(moz.valentin)
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/478e4fb80c4d
[devtools] Use frameBrowsingContextID if available in network getChannelBrowsingContextID r=webdriver-reviewers,devtools-reviewers,bomsy,whimboo
https://hg.mozilla.org/integration/autoland/rev/1b43e68405d0
[wdspec] Add a network event test asserting iframe navigations r=webdriver-reviewers,whimboo
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/43690 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
Upstream PR merged by moz-wptsync-bot
Severity: -- → S3
Points: --- → 2
Priority: -- → P2
Whiteboard: [webdriver:m9]
Whiteboard: [webdriver:m9] → [webdriver:m9][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: