Miss any of our Open RFC calls?Watch the recordings here! »

puppeteer-extra-plugin-anonymize-ua

2.2.12 • Public • Published

puppeteer-extra-plugin-anonymize-ua

A plugin for puppeteer-extra.

Install

yarn add puppeteer-extra-plugin-anonymize-ua

API

Table of Contents

Plugin

Extends: PuppeteerExtraPlugin

Anonymize the User-Agent on all pages.

Supports dynamic replacing, so the Chrome version stays intact and recent.

Type: function (opts)

  • opts Object Options (optional, default {})
    • opts.stripHeadless boolean Replace HeadlessChrome with Chrome. (optional, default true)
    • opts.makeWindows boolean Sets the platform to Windows 10, 64bit (most common). (optional, default true)
    • opts.customFn Function A custom UA replacer function. (optional, default null)

Example:

const puppeteer = require('puppeteer-extra')
puppeteer.use(require('puppeteer-extra-plugin-anonymize-ua')())
// or
puppeteer.use(require('puppeteer-extra-plugin-anonymize-ua')({
  customFn: (ua) => 'MyCoolAgent/' + ua.replace('Chrome', 'Beer')})
)
const browser = await puppeteer.launch()

Install

npm i puppeteer-extra-plugin-anonymize-ua

DownloadsWeekly Downloads

8,730

Version

2.2.12

License

MIT

Unpacked Size

18.4 kB

Total Files

10

Last publish

Collaborators

  • avatar