[meta] Extract DevTools network observer to a shared module
Categories
(Remote Protocol :: WebDriver BiDi, task)
Tracking
(Not tracked)
People
(Reporter: jdescottes, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: meta)
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.
Updated•2 years ago
|
Reporter | ||
Comment 1•2 years ago
|
||
Note the current limitation of the DevTools network monitor, which is unable to surface chrome:// resource:// file:// and data: activity.
I imagine we are going to inherit this limitation by reusing the same code for BiDi, so we should decide what to do about it. Maybe we can prioritize it and address the root cause, so that eventually devtools could also benefit from this.
Reporter | ||
Updated•2 years ago
|
Updated•2 years ago
|
Description
•