Closed Bug 1725111 Opened 3 years ago Closed 2 years ago

Add filter for top-level browsing contexts to MessageHandler broadcasting

Categories

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

task
Points:
2

Tracking

(firefox96 fixed)

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: whimboo, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

(Whiteboard: [bidi-m2-mvp])

Attachments

(2 files)

There will be a need to broadcast messages only to specific browsing-contexts and not all existent ones, eg. for event subscription to a list of top-level browsing contexts.

As such a filter criteria like an ids property needs to be added to the handleCommand() method of the MessageHandler.

The question is if this ids property should only contain top-level browsing contexts, and we control the distribution to the whole browsing context tree via an additional recursive property, or if ids should contain all the final browsing contexts already. IMHO it might be easier to use the former approach and let the handleCommand collect all required browsing contexts if required.

I agree we should only store accept top level ids, and propagate to the relevant part of the tree. I would even say we probably don't want browsing context ids at this point, given that they can change after a navigation. We should use a stable id that is guaranteed to stay the same for the given "navigable"

Points: --- → 2
Priority: -- → P3
Whiteboard: [webdriver:triage] → [bidi-m1-mvp]
Whiteboard: [bidi-m1-mvp] → [bidi-m2-mvp]
Priority: P3 → --
Priority: -- → P2

ni myself to file a follow up for session data context filtering

Flags: needinfo?(jdescottes)
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Flags: needinfo?(jdescottes)

Instead of using a broadcast boolean flag in the CommandDestination, use a contextDescriptor.
The only context descriptor type supported here is CONTEXT_DESCRIPTOR_TYPES.ALL, and the behavior is unchanged.

Depends on D131439

Add a new CONTEXT_DESCRIPTOR_TYPES for top level browsing contexts, called TOP_BROWSING_CONTEXT.
The corresponding context descriptor id should be a browserId.
The FrameTransport is updated to support both CONTEXT_DESCRIPTOR_TYPES: ALL and TOP_BROWSING_CONTEXT.
A browser mochitest is added to check that broadcasts are correctly filtered for a top level browsing context.

Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9055935bf63f
[remote] Use contextDescriptor as broadcasting argument for MessageHandler commands r=webdriver-reviewers,whimboo
https://hg.mozilla.org/integration/autoland/rev/5a48f5832e72
[remote] Add new context descriptor type TOP_BROWSING_CONTEXT r=webdriver-reviewers,whimboo

Had to update code which came from https://bugzilla.mozilla.org/show_bug.cgi?id=1731556

Flags: needinfo?(jdescottes)
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/94048774fc4f
[remote] Use contextDescriptor as broadcasting argument for MessageHandler commands r=webdriver-reviewers,whimboo
https://hg.mozilla.org/integration/autoland/rev/26497e709473
[remote] Add new context descriptor type TOP_BROWSING_CONTEXT r=webdriver-reviewers,whimboo
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: