Bug 1405706 Comment 9 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Olli Pettay [:smaug] from comment #8)

> Jan, you mean EventSource I guess.
Ah, yes, thanks for the pointer.

> What kind of information would be useful for devtools?
> https://html.spec.whatwg.org/#the-eventsource-interface
> Getting access to each incoming event? 
Yes

From user perspective:

1) The user should be able to select a URL in the Network panel
2) If there are events sent through the URL there should be a new side panel "Events"
3) The side panel shows every event and its (text) content

From API perspective:

1) The Events side panel should have access to each incoming event (to the `MessageEvent` object passed to listeners)

2) The Network panel should be able to math an event with specific HTTP channel. So, e.g. having `channelId` associated
https://searchfox.org/mozilla-central/rev/d143f8ce30d1bcfee7a1227c27bf876a85f8cede/netwerk/protocol/http/nsIHttpChannel.idl#489

3) The API could look similar to what we have for WebSockets
https://searchfox.org/mozilla-central/rev/d143f8ce30d1bcfee7a1227c27bf876a85f8cede/netwerk/protocol/websocket/nsIWebSocketEventService.idl#72

- The service allows registering listeners and get notification about every connection created and every frame sent/received.
- Mapping socket connection to HTTP channel is requested in bug 1542170

Olli, does that make sense?

> I don't think that is really available currently unless devtools manage to add event listeners to the relevant object.

I am not sure how this would work. We'd at least need a notification about new EventSource object being initialized/destroyed to add a listener to it.

Honza
(In reply to Olli Pettay [:smaug] from comment #8)

> Jan, you mean EventSource I guess.

Ah, yes, thanks for the pointer.

> What kind of information would be useful for devtools?
> https://html.spec.whatwg.org/#the-eventsource-interface
> Getting access to each incoming event? 

Yes

From user perspective:

1) The user should be able to select a URL in the Network panel
2) If there are events sent through the URL there should be a new side panel "Events"
3) The side panel shows every event and its (text) content

From API perspective:

1) The Events side panel should have access to each incoming event (to the `MessageEvent` object passed to listeners)

2) The Network panel should be able to math an event with specific HTTP channel. So, e.g. having `channelId` associated
https://searchfox.org/mozilla-central/rev/d143f8ce30d1bcfee7a1227c27bf876a85f8cede/netwerk/protocol/http/nsIHttpChannel.idl#489

3) The API could look similar to what we have for WebSockets
https://searchfox.org/mozilla-central/rev/d143f8ce30d1bcfee7a1227c27bf876a85f8cede/netwerk/protocol/websocket/nsIWebSocketEventService.idl#72

- The service allows registering listeners and get notification about every connection created and every frame sent/received.
- Mapping socket connection to HTTP channel is requested in bug 1542170

Olli, does that make sense?

> I don't think that is really available currently unless devtools manage to add event listeners to the relevant object.

I am not sure how this would work. We'd at least need a notification about new EventSource object being initialized/destroyed to add a listener to it.

Honza
(In reply to Olli Pettay [:smaug] from comment #8)

> Jan, you mean EventSource I guess.

Ah, yes, thanks for the pointer.

> What kind of information would be useful for devtools?
> https://html.spec.whatwg.org/#the-eventsource-interface
> Getting access to each incoming event? 

Yes

From user perspective:

1) The user should be able to select a URL in the Network panel
2) If there are events sent through the URL there should be a new side panel "Events"
3) The side panel shows every event and its (text) content

From API perspective:

1) The Events side panel should have access to each incoming event (to the `MessageEvent` object passed to listeners)

2) The Network panel should be able to match an event with specific HTTP channel. So, e.g. having `channelId` associated
https://searchfox.org/mozilla-central/rev/d143f8ce30d1bcfee7a1227c27bf876a85f8cede/netwerk/protocol/http/nsIHttpChannel.idl#489

3) The API could look similar to what we have for WebSockets
https://searchfox.org/mozilla-central/rev/d143f8ce30d1bcfee7a1227c27bf876a85f8cede/netwerk/protocol/websocket/nsIWebSocketEventService.idl#72

- The service allows registering listeners and get notification about every connection created and every frame sent/received.
- Mapping socket connection to HTTP channel is requested in bug 1542170

Olli, does that make sense?

> I don't think that is really available currently unless devtools manage to add event listeners to the relevant object.

I am not sure how this would work. We'd at least need a notification about new EventSource object being initialized/destroyed to add a listener to it.

Honza

Back to Bug 1405706 Comment 9