Network & File Transfers

Capture Calls

Turns the extension's request recorder on and off. It listens with webRequest, so it records every request the browser makes rather than only the ones page script issued, it keeps recording across navigations, and it touches nothing in the page. Optional parameters: capture, false to stop and true or absent to start; filter, recording only urls holding that fragment; and clear, to forget what was already recorded before starting. Starting again with a different filter keeps what is already there unless clear says otherwise.

NOTE

The recorder keeps the newest 2000 calls and counts what fell off, so a workflow that finds nothing can tell a page that never made the call from one that made too many.

Examples

GPAL Fluent: High-level fluent C# API

//The same call on every engine. This route is how OttoMagic serves it.

browser.WithCallFilter("/api/search").CaptureCalls(true);

MagicHelper: MagicHelper utility library

browser.MagicHelper.CaptureCalls(true, "/api/search");

Puppeteer Client: Puppeteer-style C# client

//Capture is a CDP subscription rather than a command, so it sits on the communicator.

// PuppeteerCommunicator handles capture. See below.

Puppeteer Communicator: Low-level communicator

//Enables the Network domain on every session GPAL knows about, not only the active tab, so a click that opens a tab is recorded too. There is no filter here: Puppeteer records everything and WithCallFilter narrows it on the GPAL side, where the extension does its own filtering before recording.

await browser.PuppeteerCommunicator.CaptureCalls(true);

await browser.PuppeteerCommunicator.CaptureCalls(false);

REST Client: Direct REST/HTTP client

//One parameter per call. CaptureCalls says whether to record, WithCallFilter narrows it, and WithClearCalls starts from nothing.

browser.OttoMagicClient.CaptureCalls(true).WithCallFilter("/api/search").Execute();

💬 Ask GPAL