front_end/panels/network/)This directory holds the Network panel. It shows the request log, the request details tabs, the request conditions drawer, and the network conditions drawer. It is in the panels layer, the top of core -> models -> ui -> panels.
The panel is mostly UI. CDP access lives in core/sdk (SDK.NetworkManager, SDK.NetworkRequest). The request log lives in models/logs (Logs.NetworkLog). HAR export lives in models/har. Timing math lives in models/network_time_calculator. Put new non-UI logic in one of those modules, not here. See core/sdk/README.md and foundation/README.md.
| GN target | Entrypoint | Visibility | Purpose |
|---|---|---|---|
:bundle | network.ts | Entrypoints, AI assistance, a few sibling panels and components, tests, devtools_panels_visibility | Public surface of the panel. |
:meta | network-meta.ts | This module, entrypoints | Lazy views, actions, setting UIs, revealers, context menu provider. |
:network | — (implementation) | — (devtools_ui_module) | All .ts sources listed in BUILD.gn. |
:css_files | *.css | — | generate_css target for the panel stylesheets. |
./forward:bundle | forward/forward.ts | models, panels, ui | Light types other modules use to link into the panel. |
./components:bundle | components/components.ts | This module, panels/application, devtools_panels_visibility | Leaf components for headers, trust tokens and direct sockets. |
BUILD.gn has the exact visibility lists. Ask an owner before you add a new consumer.
network.ts and forward/forward.ts define the public surface. Files they do not re-export are internal.
NetworkPanel (NetworkPanel.ts): the panel singleton (NetworkPanel.instance()). Also holds revealers such as RequestRevealer, RequestLocationRevealer and RequestIdRevealer, and SearchNetworkView.NetworkLogView (NetworkLogView.ts): the request grid, its filters and the summary. Uses DEFAULT_VIEW and MoreFiltersDropDownUI.NetworkRequestNode and NetworkGroupNode (NetworkDataGridNode.ts): grid rows.NetworkItemView (NetworkItemView.ts): the tabbed details view for one request.RequestConditionsDrawer (RequestConditionsDrawer.ts): drawer view network.blocked-urls.NetworkConfigView (NetworkConfigView.ts): drawer view network.config.forward and a revealerTo open a request, reveal a forward type. This keeps callers off the heavy :bundle and off the NetworkPanel singleton. network-meta.ts registers a revealer for each revealable type.
// ❌ BAD: needs the whole panel bundle, and does not show the panel first. Network.NetworkPanel.NetworkPanel.instance().revealAndHighlightRequest(request);
// ✅ GOOD: the pattern used in panels/application/FrameDetailsView.ts. const requestLocation = NetworkForward.UIRequestLocation.UIRequestLocation.tab( request, NetworkForward.UIRequestLocation.UIRequestTabs.HEADERS_COMPONENT); await Common.Revealer.reveal(requestLocation);
Widgets here such as NetworkLogView follow the UI eng vision. A presenter takes view = DEFAULT_VIEW in its constructor and calls this.#view(...). The view input holds data and callbacks. See docs/ui_engineering.md.
// ❌ BAD: the presenter hard-codes the view, so tests cannot inject a stub. MORE_FILTERS_DEFAULT_VIEW(input, undefined, this.#filterElement);
// ✅ GOOD: from MoreFiltersDropDownUI in NetworkLogView.ts. export interface MoreFiltersViewInput { hideDataURLs: boolean; onHideDataURLsChange: () => void; // ... } export class MoreFiltersDropDownUI extends Common.ObjectWrapper.ObjectWrapper<UI.FilterBar.FilterUIEventTypes> { readonly #view: MoreFiltersView; constructor(view: MoreFiltersView = MORE_FILTERS_DEFAULT_VIEW) { super(); this.#view = view; } }
Styles. Light DOM stylesheets such as networkLogView.css are wrapped in @scope to (devtools-widget > *). Prefer --sys-size-* tokens over raw pixel values.
./dt test front_end/panels/network autoninja -C out/Default front_end/panels/network:unittests ./dt lint front_end/panels/network ./dt test test/e2e/network
./components has its own unittests target. In tests that create a NetworkPanel, dispose targets and await UI.Widget.Widget.allUpdatesComplete and RenderCoordinator.done() in afterEach (see NetworkPanel.test.ts).