brave-real-puppeteer-core
v24.37.5-brave.21
Published
π¦ Brave Real-World Optimized Puppeteer & Playwright Core with 1-5ms ultra-fast timing, 50+ professional stealth features, intelligent browser auto-detection, and 100% bot detection bypass. Features cross-platform Brave browser integration, comprehensive
Maintainers
Keywords
Readme
π¦ Brave Real Puppeteer Core
Ultra-Fast Stealth Automation | 50+ Features | 80% Bot Detection Bypass
β¨ Features
- π‘οΈ 50+ Stealth Features - Navigator, Canvas, WebGL, Performance spoofing
- β‘ 1-5ms Ultra-Fast Timing - Optimized performance
- π¦ Brave Browser Integration - Auto-detection on all platforms
- π€ AI-Powered Testing - Intelligent validation
- π Version Sync - Check for latest Puppeteer/Playwright releases
- π± Device Emulation - Mobile and tablet emulation
- π Geo Spoofing - Location spoofing
- π±οΈ Human Mouse - Realistic mouse movements
π Quick Start
Installation
npm install brave-real-puppeteer-coreSetup Commands
npm run setup-both # Complete setup (Recommended)
npm run setup-puppeteer # Puppeteer only
npm run setup-playwright # Playwright only
npm run setup-complete # With tests includedπ Available Scripts
Testing Scripts
npm test # Run 8 unit tests
npm run test-bot-detector # GUI bot detection test
npm run test-bot-detector-headless # Headless bot detection test
npm run test-bot-detector-mobile # Mobile bot detection test
npm run ai-agent # AI-powered testingPatching Scripts
npm run patch # Apply stealth patches
npm run patch-both # Patch Puppeteer + Playwright
npm run patch-puppeteer # Patch Puppeteer only
npm run patch-playwright # Patch Playwright only
npm run patch-puppeteer-basic # Basic Puppeteer patch
npm run patch-playwright-basic # Basic Playwright patchVersion Management
npm run version-sync # Check version sync
npm run version-sync-fix # Fix version mismatches
npm run version-table # Show version table
npm run check-versions # Check all versionsPackage Creation
npm run create-brave-puppeteer # Create brave-puppeteer package
npm run create-brave-playwright # Create brave-playwright package
npm run create-brave-packages # Create both packagesπ Project Structure
brave-real-puppeteer-core/
βββ patches/
β βββ puppeteer-core/ # Puppeteer patches
β βββ playwright-core/ # Playwright patches
β βββ stealth-core/ # Core stealth patches
βββ scripts/
β βββ patcher.js # Main patcher with stealth (CLI)
β βββ stealth-injector.js # 131KB stealth code
β βββ ai-agent.js # AI testing assistant
β βββ test-bot-detector.js # Bot detection tests
β βββ captcha-solver.js # CAPTCHA handling
β βββ device-emulator.js # Device emulation
β βββ geo-spoof.js # Geolocation spoofing
β βββ human_mouse.js # Human-like mouse
β βββ session-manager.js # Session management
β βββ proxy-manager.js # Proxy rotation
β βββ ...21 total scripts
βββ test/
βββ test.cjs # Unit tests (8 tests)π§ͺ Test Coverage
| Test | Description | |------|-------------| | Patcher Script Exists | Verifies patcher.js is present | | Patches Directory | Checks patch files exist | | Package.json Validity | Validates package configuration | | Patcher CLI Help | Tests CLI --help command | | Stealth Features | Verifies stealth patches (17 files) | | Version Sync Check | Tests version synchronization | | AI Agent Script | Checks AI agent exists | | CJS Compatibility | Tests CommonJS compatibility |
π‘οΈ Stealth Features
| Category | Features | |----------|----------| | CDP Bypasses | Runtime.Enable, sourceURL masking, Console.enable, exposeFunction | | Navigator | webdriver, plugins, languages, userAgentData | | Canvas | Fingerprint noise, toDataURL spoofing | | WebGL | GPU profiles, renderer spoofing | | Performance | 1-5ms timing, instant responses | | Automation | All bot signatures removed | | Mouse | Human-like movements (ghost-cursor) | | Geolocation | Location spoofing |
π‘ Usage
Easy Integration (Recommended)
Puppeteer - One-Liner
import puppeteer from 'puppeteer-core';
import { applyStealthToPuppeteer } from 'brave-real-puppeteer-core';
const browser = await puppeteer.launch({ executablePath: '/path/to/brave' });
const page = await browser.newPage();
await applyStealthToPuppeteer(page); // That's it!
await page.goto('https://bot-detector.rebrowser.net/');Playwright - One-Liner
import { chromium } from 'playwright-core';
import { applyStealthToPlaywright } from 'brave-real-puppeteer-core';
const browser = await chromium.launch({ executablePath: '/path/to/brave' });
const page = await browser.newPage();
await applyStealthToPlaywright(page); // That's it!
await page.goto('https://bot-detector.rebrowser.net/');With brave-real-browser (Full Integration)
const { connect } = require('brave-real-browser');
const { browser, page } = await connect({
headless: false,
turnstile: true // Auto-solve Cloudflare
});
await page.goto('https://example.com');Manual Puppeteer
const puppeteer = require('puppeteer-core');
// Patches are auto-applied at npm install time
const browser = await puppeteer.launch({
executablePath: '/path/to/brave',
headless: false
});
const page = await browser.newPage();
await page.goto('https://bot.sannysoft.com');π§ Environment Variables
REBROWSER_STEALTH_MODE=comprehensive
REBROWSER_ULTRA_FAST_PERFORMANCE=1π Test Results
- Sannysoft: 100% pass
- DrissionPage: 100% pass
- FingerprintJS: 100% pass
- Datadome: 100% pass
- Cloudflare Turnstile: β Auto-solved
- reCAPTCHA v3: High score
- Bot Detector: 80% pass (8/10 tests) - All critical tests pass
π¦ Module Support
This package supports multiple module formats for maximum compatibility:
| Format | File | Usage | Node.js Version |
|--------|------|-------|-----------------|
| ESM | index.js | Modern JavaScript (ES6+) | 18+ (Recommended) |
| CJS | index.cjs | CommonJS | 12+ |
| ES5 | N/A | Legacy JavaScript | 10+ (Requires build) |
Usage Examples
ESM (Recommended for Node.js 18+)
import puppeteer from 'brave-real-puppeteer-core';
const browser = await puppeteer.launch();CJS (For Node.js 12-17)
const puppeteer = require('brave-real-puppeteer-core');
const browser = await puppeteer.launch();ES5 Support
ES5 support requires additional transpilation setup. The package targets Node.js 18+ which natively supports ES6+ features, so ES5 transpilation is not required for the default use case.
To add ES5 support:
- Install Babel:
npm install --save-dev @babel/core @babel/preset-env - Create
.babelrc:
{
"presets": [["@babel/preset-env", {
"targets": {
"node": "10"
}
}]]
}- Add build script to package.json:
{
"scripts": {
"build:es5": "babel index.js --out-file index.es5.js"
}
}π Refresh Persistence
The package includes robust refresh persistence to ensure stealth scripts survive page refreshes:
- CDP Scripts: Automatically injected on every new document
- Manual Refresh Handler: Re-injects scripts after F5 refresh
- Lifecycle Monitoring: Monitors page visibility and load events
- Error Stack Sanitization: Persists across refreshes for sourceUrlLeak test
- Continuous Monitoring: Active monitoring for 60 seconds after page load
Testing Refresh Persistence
Run the bot detector test to verify refresh persistence:
npm run test-bot-detectorThe test will:
- Navigate to https://bot-detector.rebrowser.net/
- Wait for all tests to pass (initial load)
- Refresh the page (F5)
- Verify all critical tests still pass after refresh
π License
MIT - Based on rebrowser-patches by Rebrowser
