# puppeteer-extra-plugin-anonymize-ua

> Anonymize User-Agent in puppeteer.

Latest version **2.4.6** (published 2023-03-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install puppeteer-extra-plugin-anonymize-ua
pnpm add puppeteer-extra-plugin-anonymize-ua
yarn add puppeteer-extra-plugin-anonymize-ua
bun add puppeteer-extra-plugin-anonymize-ua
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.4.6 |
| Published | 2023-03-01 |
| First published | 2018-05-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 2 |
| Unpacked size | 15 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7404 |
| Author | berstend |
| Maintainers | berstend |
| Keywords | puppeteer, puppeteer-extra, puppeteer-extra-plugin, ua, user-agent, chrome, headless, pupeteer |

## Links

- npm: https://www.npmjs.com/package/puppeteer-extra-plugin-anonymize-ua
- Repository: https://github.com/berstend/puppeteer-extra
- Homepage: https://github.com/berstend/puppeteer-extra#readme
- Issues: https://github.com/berstend/puppeteer-extra/issues
- npm.io page: https://npm.io/package/puppeteer-extra-plugin-anonymize-ua

## Dependencies (2)

- [debug](https://npm.io/package/debug.md) ^4.1.1
- [puppeteer-extra-plugin](https://npm.io/package/puppeteer-extra-plugin.md) ^3.2.3

## Alternatives

- [@snazzah/davey](https://npm.io/package/@snazzah/davey.md) — 1.5M weekly downloads
- [@vendure/testing](https://npm.io/package/@vendure/testing.md) — 8.3K weekly downloads
- [vue-simple-context-menu](https://npm.io/package/vue-simple-context-menu.md) — 6.6K weekly downloads
- [cypress-webpack-preprocessor-v5](https://npm.io/package/cypress-webpack-preprocessor-v5.md) — 2.1K weekly downloads
- [@backstage/plugin-catalog-backend-module-puppetdb](https://npm.io/package/@backstage/plugin-catalog-backend-module-puppetdb.md) — 1.3K weekly downloads

## Recent versions

- 2.4.6 (latest) — 2023-03-01
- 2.4.5 — 2023-03-01
- 2.4.4 — 2022-07-07
- 2.4.3 — 2022-07-07
- 2.4.2 — 2022-07-07
- 2.4.1 — 2022-07-06
- 2.4.0 — 2022-06-20
- 2.3.3 — 2021-09-28
- 2.3.2 — 2021-09-25
- 2.3.1 — 2021-09-23
- 2.3.0 — 2021-09-21
- 2.2.17 — 2021-03-14
- 2.2.16 — 2021-02-15
- 2.2.15 — 2021-01-13
- 2.2.14 — 2020-08-18
- … 26 more at https://npm.io/package/puppeteer-extra-plugin-anonymize-ua/versions

## README

# puppeteer-extra-plugin-anonymize-ua

> A plugin for [puppeteer-extra](https://github.com/berstend/puppeteer-extra).

### Install

```bash
yarn add puppeteer-extra-plugin-anonymize-ua
```

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

-   [Plugin](#plugin)

### [Plugin](https://github.com/berstend/puppeteer-extra/blob/db57ea66cf10d407cf63af387892492e495a84f2/packages/puppeteer-extra-plugin-anonymize-ua/index.js#L24-L51)

**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](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options (optional, default `{}`)
    -   `opts.stripHeadless` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Replace `HeadlessChrome` with `Chrome`. (optional, default `true`)
    -   `opts.makeWindows` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Sets the platform to Windows 10, 64bit (most common). (optional, default `true`)
    -   `opts.customFn` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** A custom UA replacer function. (optional, default `null`)

Example:

```javascript
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()
```

* * *

---
_Source: https://npm.io/package/puppeteer-extra-plugin-anonymize-ua · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
