Bug 1787445 Comment 0 Edit History

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

We want to reuse the network observer from DevTools in WebDriver BiDi and CDP.

The first step is to extract all the related code to a shared JavaScript module (jsm or sys.mjs) that can be loaded without involving the DevTools Loader and which has no DevTools dependency.

Such work was already performed as part of the HAR prototyping effort for BiDi at  https://phabricator.services.mozilla.com/D154868

As can be seen on the revision, the main modules that had to be extracted were:
- https://searchfox.org/mozilla-central/source/devtools/server/actors/network-monitor/utils/channel-map.js
- https://searchfox.org/mozilla-central/source/devtools/server/actors/network-monitor/network-observer.js
- https://searchfox.org/mozilla-central/source/devtools/server/actors/network-monitor/utils/network-utils.js
- https://searchfox.org/mozilla-central/source/devtools/server/actors/network-monitor/network-response-listener.js
- https://searchfox.org/mozilla-central/source/devtools/shared/webconsole/network-helper.js
- https://searchfox.org/mozilla-central/source/devtools/shared/webconsole/throttle.js

The entry point from external code is normally only network-observer.js. 

On top of extracting the code, we should also cleanup the interface so that methods and emitted events are not devtools specific.
We want to reuse the network observer from DevTools in WebDriver BiDi and CDP.

The first step is to extract all the related code to a shared JavaScript module (jsm or sys.mjs) that can be loaded without involving the DevTools Loader and which has no DevTools dependency.

Such work was already performed as part of the HAR prototyping effort for BiDi at  https://phabricator.services.mozilla.com/D154868

As can be seen on the revision, the main modules that had to be extracted were:
- https://searchfox.org/mozilla-central/source/devtools/server/actors/network-monitor/utils/channel-map.js
- https://searchfox.org/mozilla-central/source/devtools/server/actors/network-monitor/network-observer.js
- https://searchfox.org/mozilla-central/source/devtools/server/actors/network-monitor/utils/network-utils.js
- https://searchfox.org/mozilla-central/source/devtools/server/actors/network-monitor/network-response-listener.js
- https://searchfox.org/mozilla-central/source/devtools/shared/webconsole/network-helper.js
- https://searchfox.org/mozilla-central/source/devtools/shared/webconsole/throttle.js

The entry point from external code is normally only network-observer.js. 

On top of extracting the code, we should also cleanup the interface so that methods and emitted events are not devtools specific.

Another question to answer will be the location for this module. We need to make sure the module is always included in the build whenever DevTools or RemoteAgent are built.

Back to Bug 1787445 Comment 0