Open Bug 1805479 Opened 1 year ago Updated 1 month ago

Add "initiator" to "network.beforeRequestSent" event

Categories

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

task
Points:
3

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned)

References

(Blocks 3 open bugs)

Details

(Whiteboard: [webdriver:m11])

BiDi network events should contain Initiator data defined in the current PR as

network.Initiator = {
    type: "parser" / "script" / "preflight" / "other",
    ?columnNumber: uint,
    ?lineNumber: uint,
    ?stackTrace: StackTrace,
    ?request: network.Request
};

At the time of filing the logic to compute the type is not clear:

TODO: Get the type. It’s not quite clear how this ought to work; the CDP data depends on whether the navigation was kicked off by the parser or by script (so e.g. inserting an image from script causes the initiator to be "script"), but that doesn’t correspond to anything in Fetch.

Also stackTrace information is not accessible from the parent process, so it will be more complicated to add this information, since for ow our implementation for beforeRequestSent lives only in the parent process.

Priority: -- → P3
Whiteboard: [webdriver:backlog]
Duplicate of this bug: 1824191
Points: --- → 5
Priority: P3 → P1
Whiteboard: [webdriver:backlog] → [webdriver:m7]
Priority: P1 → P2

After talking to Julian we are going to de-prioritize this bug for now. We will re-evaluate once it becomes a blocker for some WebDriver BiDi API.

Priority: P2 → P3
Whiteboard: [webdriver:m7] → [webdriver:backlog]

It's used in some P2 Puppeteer tests and users wanted to have it for CDP so most likely BiDi as well. We should check how hard it is to implement.

Priority: P3 → --
Whiteboard: [webdriver:backlog] → [webdriver:triage]

We will split out the stacktrace part out if this bug, but this still requires clarification to know which initiator type should be set for which use cases.

Priority: -- → P2
Whiteboard: [webdriver:triage] → [webdriver:m10]
Summary: Add initiator and stacktrace details to Network BiDi events → Add initiator to Network BiDi events
Blocks: 1877187
Points: 5 → 3

For reference, the current logic to handle this in DevTools can be found around https://searchfox.org/mozilla-central/rev/3c72de9280ec57dc55c24886c6334d9e340500e8/devtools/shared/network-observer/NetworkUtils.sys.mjs#24-69

Of course we might need to change it to make it spec compliant.

Julian, as it looks like this is only needed for the network.beforeRequestSent event or do I miss something?

That's correct, updated the bug accordingly

No longer blocks: 1790369, 1790371
Summary: Add initiator to Network BiDi events → Add initiator to network.beforeRequestSent
Summary: Add initiator to network.beforeRequestSent → Add "initiator" to "network.beforeRequestSent" event
Whiteboard: [webdriver:m10] → [webdriver:m11]
You need to log in before you can comment on or make changes to this bug.