puppeteer-extra-plugin-block-send-beacon
v0.1.0
Published
puppeteer-extra plugin that blocks navigator.sendBeacon by replacing it with a no-op returning true.
Readme
puppeteer-extra-plugin-block-ping
puppeteer-extra plugin that disables navigator.sendBeacon() by replacing it with a no-op function that returns true.
This avoids request interception and therefore does not rely on blocking Puppeteer's ping resource type.
Install
npm install puppeteer-extra-plugin-block-pingUsage
const puppeteer = require('puppeteer-extra')
const blockPingPlugin = require('puppeteer-extra-plugin-block-ping')
puppeteer.use(blockPingPlugin())
const browser = await puppeteer.launch()
const context = await browser.createBrowserContext()
const page = await context.newPage()
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' })The plugin injects the override in onPageCreated, so it also applies to pages created from browser.createBrowserContext().newPage().
