Gathering detailed insights and metrics for puppeteer-extra-plugin-notbody-stealth
Gathering detailed insights and metrics for puppeteer-extra-plugin-notbody-stealth
Gathering detailed insights and metrics for puppeteer-extra-plugin-notbody-stealth
Gathering detailed insights and metrics for puppeteer-extra-plugin-notbody-stealth
💯 Teach puppeteer new tricks through plugins.
npm install puppeteer-extra-plugin-notbody-stealth
Typescript
Module System
Min. Node Version
Node Version
NPM Version
72.2
Supply Chain
96.3
Quality
73.6
Maintenance
100
Vulnerability
98.2
License
JavaScript (59.86%)
TypeScript (39.86%)
HTML (0.19%)
Shell (0.09%)
Total Downloads
2,108
Last Day
1
Last Week
15
Last Month
75
Last Year
877
MIT License
6,966 Stars
604 Commits
764 Forks
115 Watchers
5 Branches
49 Contributors
Updated on Aug 01, 2025
Latest Version
2.11.2
Package Id
puppeteer-extra-plugin-notbody-stealth@2.11.2
Unpacked Size
267.86 kB
Size
58.45 kB
File Count
100
NPM Version
lerna/3.22.1/node@v16.10.0+arm64 (darwin)
Node Version
16.10.0
Published on
Jan 18, 2023
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
275%
15
Compared to previous week
Last Month
41.5%
75
Compared to previous month
Last Year
-14.9%
877
Compared to previous year
2
A plugin for puppeteer-extra and playwright-extra to prevent detection.
1yarn add puppeteer-extra-plugin-stealth 2# - or - 3npm install puppeteer-extra-plugin-stealth
If this is your first puppeteer-extra plugin here's everything you need:
1yarn add puppeteer puppeteer-extra puppeteer-extra-plugin-stealth 2# - or - 3npm install puppeteer puppeteer-extra puppeteer-extra-plugin-stealth
1// puppeteer-extra is a drop-in replacement for puppeteer, 2// it augments the installed puppeteer with plugin functionality 3const puppeteer = require('puppeteer-extra') 4 5// add stealth plugin and use defaults (all evasion techniques) 6const StealthPlugin = require('puppeteer-extra-plugin-stealth') 7puppeteer.use(StealthPlugin()) 8 9// puppeteer usage as normal 10puppeteer.launch({ headless: true }).then(async browser => { 11 console.log('Running tests..') 12 const page = await browser.newPage() 13 await page.goto('https://bot.sannysoft.com') 14 await page.waitForTimeout(5000) 15 await page.screenshot({ path: 'testresult.png', fullPage: true }) 16 await browser.close() 17 console.log(`All done, check the screenshot. ✨`) 18})
puppeteer-extra
and most plugins are written in TS, so you get perfect type support out of the box. :)
1import puppeteer from 'puppeteer-extra' 2import StealthPlugin from 'puppeteer-extra-plugin-stealth' 3 4puppeteer 5 .use(StealthPlugin()) 6 .launch({ headless: true }) 7 .then(async browser => { 8 const page = await browser.newPage() 9 await page.goto('https://bot.sannysoft.com') 10 await page.waitForTimeout(5000) 11 await page.screenshot({ path: 'stealth.png', fullPage: true }) 12 await browser.close() 13 })
Please check this wiki entry in case you have TypeScript related import issues.
Please check out the main documentation to learn more about
puppeteer-extra
(Firefox usage, other Plugins, etc).
puppeteer-extra
with stealth passes all public bot tests.Please note: I consider this a friendly competition in a rather interesting cat and mouse game. If the other team (👋) wants to detect headless chromium there are still ways to do that (at least I noticed a few, which I'll tackle in future updates).
It's probably impossible to prevent all ways to detect headless chromium, but it should be possible to make it so difficult that it becomes cost-prohibitive or triggers too many false-positives to be feasible.
If something new comes up or you experience a problem, please do your homework and create a PR in a respectful way (this is Github, not reddit) or I might not be motivated to help. :)
🎁 Note: Until we've automated changelog updates in markdown files please follow the
#announcements
channel in our discord server for the latest updates and changelog info.
Older changelog:
v2.4.7
user-agent-override
- Used to set a stealthy UA string, language & platform. This also fixes issues with the prior method of setting the Accept-Language
header through request interception (#104, kudos to @Niek)navigator.vendor
- Makes it possible to optionally override navigator.vendor (#110, thanks @Niek)navigator.webdriver
: Now uses ES6 Proxies to pass instanceof
tests (#117, thanks @aabbccsmith)user-agent
, accept-language
(now obsolete)v2.4.2
/ v2.4.1
iframe.contentWindow
- We now proxy the original window object and smartly redirect calls that might reveal it's true identity, as opposed to mocking it like peasants :)accept-language
- More robust and it's now possible to set a custom locale if needed.v2.4.0
Let's ring the bell for round 2 in this cat and mouse fight 😄
media.codecs
- we spoof the presence of proprietary codecs in Chromium nowiframe.contentWindow
- Found a way to fix srcdoc
frame based detection without breaking recaptcha inline popup & other iframes (please report any issues)accept-language
- Adds a missing Accept-Language
header in headless (capitalized correctly, page.setExtraHTTPHeaders
is all lowercase which can be detected)chrome.runtime
- More extensive mocking of the chrome objectareyouheadless
testv2.1.2
navigator.plugins
- we fully emulate plugins/mimetypes in headless now 🎉webgl.vendor
- is otherwise set to "Google" in headlesswindow.outerdimensions
- fix missing window.outerWidth/outerHeight and viewportnavigator.webdriver
now returns undefined instead of false![]() | ![]() | ![]() | ![]() |
![]() | ![]() | ![]() | ![]() |
Note: The
MQ_SCREEN
test is broken on their page (will fail in regular Chrome as well).
Tests have been done using this test site and these scripts.
Using stealth also seems to help with maintaining a normal reCAPTCHA v3 score.
Regular Puppeteer ![]() | Stealth Puppeteer ![]() |
Note: The official test is to be taken with a grain of salt, as the score is calculated individually per site and multiple other factors (past behaviour, IP address, etc). Based on anecdotal observations it still seems to work as a rough indicator.
Tip: Have a look at the recaptcha plugin if you have issues with reCAPTCHAs.
opts
Object? Options (optional, default {}
)
Extends: PuppeteerExtraPlugin
Stealth mode: Applies various techniques to make detection of headless puppeteer harder. 💯
There are a couple of ways the use of puppeteer can easily be detected by a target website.
The addition of HeadlessChrome
to the user-agent being only the most obvious one.
The goal of this plugin is to be the definite companion to puppeteer to avoid detection, applying new techniques as they surface.
As this cat & mouse game is in it's infancy and fast-paced the plugin is kept as flexibile as possible, to support quick testing and iterations.
This plugin uses puppeteer-extra
's dependency system to only require
code mods for evasions that have been enabled, to keep things modular and efficient.
The stealth
plugin is a convenience wrapper that requires multiple evasion techniques
automatically and comes with defaults. You could also bypass the main module and require
specific evasion plugins yourself, if you whish to do so (as they're standalone puppeteer-extra
plugins):
1// bypass main module and require a specific stealth plugin directly: 2puppeteer.use( 3 require('puppeteer-extra-plugin-stealth/evasions/console.debug')() 4)
PRs are welcome, if you want to add a new evasion technique I suggest you look at the template to kickstart things.
Thanks to Evan Sangaline and Paul Irish for kickstarting the discussion!
Example:
1const puppeteer = require('puppeteer-extra') 2// Enable stealth plugin with all evasions 3puppeteer.use(require('puppeteer-extra-plugin-stealth')()) 4;(async () => { 5 // Launch the browser in headless mode and set up a page. 6 const browser = await puppeteer.launch({ 7 args: ['--no-sandbox'], 8 headless: true 9 }) 10 const page = await browser.newPage() 11 12 // Navigate to the page that will perform the tests. 13 const testUrl = 14 'https://intoli.com/blog/' + 15 'not-possible-to-block-chrome-headless/chrome-headless-test.html' 16 await page.goto(testUrl) 17 18 // Save a screenshot of the results. 19 const screenshotPath = '/tmp/headless-test-result.png' 20 await page.screenshot({ path: screenshotPath }) 21 console.log('have a look at the screenshot:', screenshotPath) 22 23 await browser.close() 24})()
Get all available evasions.
Please look into the evasions directory for an up to date list.
Example:
1const pluginStealth = require('puppeteer-extra-plugin-stealth')() 2console.log(pluginStealth.availableEvasions) // => Set { 'user-agent', 'console.debug' } 3puppeteer.use(pluginStealth)
Get all enabled evasions.
Enabled evasions can be configured either through opts
or by modifying this property.
Example:
1// Remove specific evasion from enabled ones dynamically 2const pluginStealth = require('puppeteer-extra-plugin-stealth')() 3pluginStealth.enabledEvasions.delete('console.debug') 4puppeteer.use(pluginStealth)
opts
Object? Options
Default export, PuppeteerExtraStealthPlugin
Copyright © 2018 - 2022, berstend̡̲̫̹̠̖͚͓̔̄̓̐̄͛̀͘. Released under the MIT License.
No vulnerabilities found.