Bug 1555057 Comment 43 Edit History

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

Just had a quick meeting with Luca and here are some comments:

1) As stated in comment #39 `A filter like *$image however will block the network request before a connection to the remote server is made.`
This means that `NetworResponseListener` is never instantiated and registered for such request 
https://searchfox.org/mozilla-central/rev/557a0e222dd104c5d805ba344c45d6abc27d3db0/devtools/server/actors/network-monitor/network-observer.js#923

And it explains why `onStopRequest` (callback on `NetworResponseListener`) is never called
https://searchfox.org/mozilla-central/rev/557a0e222dd104c5d805ba344c45d6abc27d3db0/devtools/server/actors/network-monitor/network-response-listener.js#365

2) So, we only have `_httpStopRequest` callback that handles  `http-on-stop-request`  observer notificaiton
https://searchfox.org/mozilla-central/rev/557a0e222dd104c5d805ba344c45d6abc27d3db0/devtools/server/actors/network-monitor/network-observer.js#314 

This notification is fired for all blocked requests (no matter when uBlock does it's blocking)

3) What we need to do is firing an event from `_httpStopRequest` informing the client (the Network panel) that there is blocked request.

An example of how this can be done is e.g. `addResponseContent`
https://searchfox.org/mozilla-central/rev/557a0e222dd104c5d805ba344c45d6abc27d3db0/devtools/server/actors/network-monitor/network-response-listener.js#505

The method is implemented here:
https://searchfox.org/mozilla-central/rev/557a0e222dd104c5d805ba344c45d6abc27d3db0/devtools/server/actors/network-monitor/network-event.js#504

It emits new event `network-event-update:response-content`

See also my comment here the `=== Implementation ===` part that explains how to send data from the backend to the client
https://bugzilla.mozilla.org/show_bug.cgi?id=1358038#c18
This comment is about utilizing an existing RDP packet type but, we need to create new one

Pranav, let me know if this is enough information to make a progress.

Honza
Just had a quick meeting with Luca and here are some comments:

1) As stated in comment #39 `A filter like *$image however will block the network request before a connection to the remote server is made.`
This means that `NetworResponseListener` is never instantiated and registered for such request 
https://searchfox.org/mozilla-central/rev/557a0e222dd104c5d805ba344c45d6abc27d3db0/devtools/server/actors/network-monitor/network-observer.js#923

And it explains why `onStopRequest` (callback on `NetworResponseListener`) is never called
https://searchfox.org/mozilla-central/rev/557a0e222dd104c5d805ba344c45d6abc27d3db0/devtools/server/actors/network-monitor/network-response-listener.js#365

2) So, we only have `_httpStopRequest` callback that handles  `http-on-stop-request`  observer notificaiton
https://searchfox.org/mozilla-central/rev/557a0e222dd104c5d805ba344c45d6abc27d3db0/devtools/server/actors/network-monitor/network-observer.js#314 

This notification is fired for all blocked requests (no matter when uBlock does it's blocking)

3) What we need to do is firing an event from `_httpStopRequest` informing the client (the Network panel) that there is blocked request.

An example of how this can be done is e.g. `addResponseContent`
https://searchfox.org/mozilla-central/rev/557a0e222dd104c5d805ba344c45d6abc27d3db0/devtools/server/actors/network-monitor/network-response-listener.js#505

The method is implemented here:
https://searchfox.org/mozilla-central/rev/557a0e222dd104c5d805ba344c45d6abc27d3db0/devtools/server/actors/network-monitor/network-event.js#504

It emits new event `network-event-update:response-content`

See also my comment here the `=== Implementation ===` part that explains how to send data from the backend to the client
https://bugzilla.mozilla.org/show_bug.cgi?id=1358038#c18

Pranav, let me know if this is enough information to make a progress.

Honza

Back to Bug 1555057 Comment 43