npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

puppeteer-ghost

v0.0.17

Published

puppeteer library to bypass bot detection

Readme

👻 Puppeteer Ghost

npm Ask DeepWiki

  • Bypass CDP, Proxy, webdriver detection
  • Blocks WebRTC to prevent IP leaks
  • Works exactly like regular Puppeteer - just import and use
  • Supports proxy configuration with authentication

Installation

pnpm add puppeteer-ghost
# or
npm install puppeteer-ghost
# or
yarn add puppeteer-ghost

Quick Start

import puppeteer from 'puppeteer-ghost';

// Launch with optimized defaults - no configuration needed
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://www.browserscan.net/');

Default Configuration:

  • headless: false - Browser window is visible by default
  • defaultViewport: null - Uses full browser window size
  • Anti-detection features automatically enabled
  • Single tab behavior (no duplicate tabs)

Configuration

Custom Launch Options

/**
 * @type {import('puppeteer-ghost').GhostLaunchOptions}
 */
const launchOptions = {
    headless: true, // Run in headless mode
    args: ['--window-size=1920,1080'] // Custom browser arguments
};

const browser = await puppeteer.launch(launchOptions);

Advanced Configuration:

/**
 * @type {import('puppeteer-ghost').GhostLaunchOptions}
 */
const advancedOptions = {
    headless: false,
    defaultViewport: { width: 1920, height: 1080 },
    useSystemBrowser: true, // Use system Chrome (default: true)
    args: ['--disable-web-security', '--disable-features=VizDisplayCompositor'],
    proxy: {
        server: 'http://proxy.example.com:8080',
        username: 'user',
        password: 'pass'
    }
};

Browser Selection

By default, puppeteer-ghost uses your system's installed Chrome. You can switch to Puppeteer's bundled Chromium:

// Use system Chrome (default)
const browser = await puppeteer.launch({
    useSystemBrowser: true
});

// Use Puppeteer's bundled Chromium
const browser = await puppeteer.launch({
    useSystemBrowser: false
});

// Custom executable path (overrides useSystemBrowser)
const browser = await puppeteer.launch({
    executablePath: '/path/to/chrome'
});

Proxy Configuration

/**
 * @type {import('puppeteer-ghost').ProxyConfig}
 */
const proxyConfig = {
    server: 'http://proxy.example.com:8080',
    username: 'your-username', // optional
    password: 'your-password' // optional
};

const browser = await puppeteer.launch({
    proxy: proxyConfig
});

const page = await browser.newPage();
await page.goto('https://www.browserscan.net');

Extension Support

Load Chrome extensions with puppeteer-ghost:

import path from 'path';
import fs from 'fs';
const extensionPath = path.join(process.cwd(), 'extension-folder');
const browser = await puppeteer.launch({
    pipe: true, // required for extensions
    enableExtensions: [extensionPath]
});

API Reference

Core API

puppeteer.launch(options?)

Launches a new browser instance with built-in anti-detection capabilities.

/**
 * @param {GhostLaunchOptions} [options] - Launch configuration
 * @returns {Promise<GhostBrowser>} Enhanced browser instance
 */
const browser = await puppeteer.launch(options);

Example:

const browser = await puppeteer.launch({
    headless: false,
    proxy: {
        server: 'http://proxy.example.com:8080',
        username: 'user',
        password: 'pass'
    }
});

Type Definitions

GhostLaunchOptions

Extends Puppeteer's LaunchOptions with additional anti-detection properties:

interface GhostLaunchOptions extends LaunchOptions {
    /** Proxy configuration for routing traffic */
    proxy?: ProxyConfig;
    /** Use system browser instead of bundled Chromium (default: true) */
    useSystemBrowser?: boolean;
}

ProxyConfig

Configuration object for proxy settings:

interface ProxyConfig {
    /** Proxy server URL (http://host:port, https://host:port, socks5://host:port) */
    server: string;
    /** Authentication username (optional) */
    username?: string;
    /** Authentication password (optional) */
    password?: string;
}

GhostBrowser

Enhanced browser instance with anti-detection features:

interface GhostBrowser extends Browser {
    /** Creates a new page with anti-detection enabled */
    newPage(): Promise<GhostPage>;
}

GhostPage

Enhanced page instance with human-like interactions:

interface GhostPage extends Page {
    /** Click with randomized positioning and timing */
    click(selector: string, options?: MouseClickOptions): Promise<void>;
    /** Type with human-like delays between keystrokes */
    type(selector: string, text: string, options?: TypeOptions): Promise<void>;
}

TypeOptions

Options for the enhanced type method:

interface TypeOptions {
    /** Delay between keystrokes in milliseconds (default: random 10-50ms) */
    delay?: number;
}

Enhanced Methods

browser.newPage()

Creates a new page with anti-detection features automatically enabled.

/**
 * @returns {Promise<GhostPage>} Enhanced page instance
 */
const page = await browser.newPage();

Features enabled:

  • WebRTC blocking to prevent IP leaks
  • Proxy authentication (if configured)
  • Human-like interaction methods

page.click(selector, options?)

Clicks on an element with human-like behavior including randomized positioning and timing delays.

/**
 * @param {string} selector - CSS selector to click
 * @param {MouseClickOptions} [options] - Click options
 * @returns {Promise<void>}
 */
await page.click('#submit-button', { button: 'left' });

page.type(selector, text, options?)

Types text into an element with human-like delays between keystrokes.

/**
 * @param {string} selector - CSS selector to type into
 * @param {string} text - Text to type
 * @param {TypeOptions} [options] - Typing options
 * @returns {Promise<void>}
 */
await page.type('#username', 'myusername', { delay: 100 });

License

ISC License - see the LICENSE file for details.

Issues

Found a bug? Open an issue or start a discussion.