Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Microsoft Playwright FfNetworkManager

From Leeroopedia

Template:Implementation Page

Overview

FFNetworkManager manages network request lifecycle and interception for Firefox browser pages, translating Firefox Network domain events into Playwright's network abstractions.

Description

The FFNetworkManager class listens to Firefox Juggler protocol network events and creates/manages InterceptableRequest objects. It handles the full request lifecycle: request creation, response reception, request completion, and failure. It also supports request interception for route handling, allowing requests to be modified, fulfilled, or aborted.

The companion InterceptableRequest class wraps individual network requests with interception capabilities, bridging between Firefox protocol events and Playwright's network.Request and network.Route abstractions.

Usage

Created internally by the Firefox page implementation. One instance per page session.

Code Reference

Source Location

packages/playwright-core/src/server/firefox/ffNetworkManager.ts (272 lines)

Class Signature

export class FFNetworkManager {
  constructor(session: FFSession, page: Page)
  dispose(): void
  async setRequestInterception(enabled: boolean): Promise<void>
}

Import

import { FFNetworkManager } from './server/firefox/ffNetworkManager';

I/O Contract

Inputs

  • session: FFSession -- Firefox protocol session for network commands
  • page: Page -- parent page for emitting network events
  • Network protocol events: requestWillBeSent, responseReceived, requestFinished, requestFailed

Outputs

  • Creates network.Request and network.Response objects
  • Emits network lifecycle events on the page
  • Manages request interception via Network.setRequestInterception

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment