🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@themarkup/puppeteer-har

Package Overview
Dependencies
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@themarkup/puppeteer-har

Generate HAR file with Puppeteer

latest
Source
npmnpm
Version
0.0.0
Version published
Weekly downloads
127
19.81%
Maintainers
4
Weekly downloads
 
Created
Source

puppeteer-har

Generate HAR file with puppeteer.

Install

npm install @the-markup/puppeteer-har

Usage

import puppeteer from "puppeteer"
import { captureNetwork } from "puppeteer-har"

const browser = await puppeteer.launch()
const page = await browser.newPage()

const getHar = await captureNetwork(page)

await page.goto("http://example.com")

const har = await getHar()
await browser.close()

captureNetwork(page[, options])

Start capturing the network traffic of the given puppeteer page.

Options

saveResponses

Defaults to false. If set the HAR file will also include the responses to network requests.

captureMimeTypes

Defaults to ['text/html', 'application/json']. When responses should be saved you can specify which response types to include through this array.

Returns

captureNetwork returns a method that will stop capturing traffic and return a HAR file when called.

getHar()

arguments

fileName (optional) - A string that is used as a filename for the generated HAR file. If provided, the HAR file will be saved to this location. If not passed in, the function will directly return the HAR JSON.

Keywords

har

FAQs

Package last updated on 16 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts