MCPcopy
hub / github.com/berstend/puppeteer-extra

github.com/berstend/puppeteer-extra @4.3.6 sqlite

repository ↗ · DeepWiki ↗ · release 4.3.6 ↗
727 symbols 1,466 edges 159 files 154 documented · 21%
README

puppeteer-extra Downloads

This is the monorepo for puppeteer-extra, a modular plugin framework for puppeteer. :-)

🌟 For the main documentation, please head over to the puppeteer-extra package.

We've also recently introduced support for Playwright, if you're interested in that head over to playwright-extra.

Monorepo

Contributing

Contributing

PRs and new plugins are welcome! The plugin API for puppeteer-extra is clean and fun to use. Have a look the PuppeteerExtraPlugin base class documentation to get going and check out the existing plugins (minimal example is the anonymize-ua plugin) for reference.

We use a monorepo powered by Lerna (and yarn workspaces), ava for testing, the standard style for linting and JSDoc heavily to auto-generate markdown documentation based on code. :-)

Lerna

Lerna

This monorepo is powered by Lerna and yarn workspaces.

Initial setup

# Install deps
yarn

# Bootstrap the packages in the current Lerna repo.
# Installs all of their dependencies and links any cross-dependencies.
yarn bootstrap

# Build all TypeScript sources
yarn build

Development flow

# Install debug in all packages
yarn lerna add debug

# Install fs-extra to puppeteer-extra-plugin-user-data-dir
yarn lerna add fs-extra --scope=puppeteer-extra-plugin-user-data-dir

# Remove dependency
# https://github.com/lerna/lerna/issues/833
yarn lerna exec --concurrency 1 'yarn remove fs-extra; echo 0'

# Run test in all packages
yarn test

# Update JSDoc based documentation in markdown files
yarn docs

# Upgrade project wide deps like puppeteer
# (We keep the devDependency version blurry)
rm -rf node_modules
rm -rf yarn.lock
yarn
yarn lerna bootstrap

# Update deps within packages (interactive)
yarn lernaupdate

# If in doubt :-(
yarn lerna exec "rm -f yarn.lock; rm -rf node_modules; echo 0"
rm -f yarn.lock &&  rm -rf node_modules && yarn cache clean

# Run tests of specific package
cd packages/puppeteer-extra-plugin-stealth
yarn test

# Run tests of specific stealth evasion
cd packages/puppeteer-extra-plugin-stealth
yarn ava -v ./evasions/user-agent-override/index.test.js

# Test a local monorepo package in an outside folder as it would've been installed from the registry
# Change PACKAGE_DIR to the path of this monorepo and PACKAGE to the package you wish to install
PACKAGE=puppeteer-extra PACKAGE_DIR=/Users/foo/puppeteer-extra/packages && yarn remove $(echo $PACKAGE); true && rm -f $(pwd)/$(echo $PACKAGE)-latest.tgz && yarn --cwd $(echo $PACKAGE_DIR)/$(echo $PACKAGE) pack --filename $(pwd)/$(echo $PACKAGE)-latest.tgz && YARN_CACHE_FOLDER=/tmp/yarn yarn add file:$(pwd)/$(echo $PACKAGE)-latest.tgz && rm -rf /tmp/yarn

Publishing

# make sure you're signed into npm before publishing
# yarn publishing is broken so lerna uses npm
npm whoami

# ensure everything is up2date and peachy
yarn
yarn bootstrap
yarn lerna link
yarn build
yarn test

# Phew, let's publish these packages!
# - Will publish all changed packages
# - Will ask for new pkg version per package
# - Will updated inter-package dependency versions automatically
yarn lerna publish

# Fix new dependency version symlinks
yarn bootstrap && yarn lerna link

Extension points exported contracts — how you extend this code

AugmentedLauncherAPIs (Interface)
* The Playwright browser launcher APIs we're augmenting * @private [1 implementers]
packages/playwright-extra/src/extra.ts
VanillaPuppeteer (Interface)
(no doc) [2 implementers]
packages/puppeteer-extra/src/index.ts
Page (Interface)
(no doc) [1 implementers]
packages/puppeteer-extra-plugin-repl/index.d.ts
Page (Interface)
(no doc) [1 implementers]
packages/puppeteer-extra-plugin-recaptcha/src/puppeteer-mods.d.ts
SymbolConstructor (Interface)
(no doc)
packages/puppeteer-extra-plugin-adblocker/src/ambient.d.ts
PuppeteerLaunchOptions (Interface)
(no doc)
packages/plugin-proxy-router/src/plugin.ts
PluginOptions (Interface)
(no doc)
packages/puppeteer-extra-plugin-block-resources/index.d.ts
SymbolConstructor (Interface)
(no doc)
packages/puppeteer-extra-plugin/src/ambient.d.ts

Core symbols most depended-on inside this repo

launch
called by 128
packages/puppeteer-extra/src/puppeteer-legacy.d.ts
use
called by 86
packages/puppeteer-extra/src/index.ts
debug
called by 80
packages/puppeteer-extra-plugin/src/index.ts
addExtra
called by 67
packages/puppeteer-extra/src/index.ts
close
called by 64
packages/puppeteer-extra-plugin-devtools/index.js
apply
called by 23
packages/puppeteer-extra-plugin-stealth/evasions/navigator.permissions/index.js
close
called by 21
packages/plugin-proxy-router/src/router.ts
get
called by 20
packages/puppeteer-extra-plugin-stealth/evasions/navigator.plugins/index.js

Shape

Method 417
Function 139
Class 114
Interface 57

Languages

TypeScript100%

Modules by API surface

packages/puppeteer-extra-plugin-recaptcha/src/content.ts32 symbols
packages/puppeteer-extra-plugin/src/index.ts31 symbols
packages/playwright-extra/src/types/index.ts31 symbols
packages/puppeteer-extra/src/index.ts26 symbols
packages/puppeteer-extra-plugin-devtools/lib/RemoteDevTools.js25 symbols
packages/playwright-extra/src/plugins.ts23 symbols
packages/puppeteer-extra-plugin-stealth/evasions/chrome.loadTimes/index.js19 symbols
packages/puppeteer-extra-plugin-recaptcha/src/index.ts18 symbols
packages/playwright-extra/test/fixtures/dummyplugin.ts18 symbols
packages/puppeteer-extra-plugin-stealth/evasions/user-agent-override/index.js17 symbols
packages/puppeteer-extra/test/events.js16 symbols
packages/puppeteer-extra-plugin-devtools/index.js15 symbols

Dependencies from manifests, versioned

@cliqz/adblocker-puppeteer1.23.8 · 1×
@playwright/test1.23.1 · 1×
@types/debug4.1.5 · 1×
@types/node18.0.0 · 1×
@types/node-fetch2.5.4 · 1×
ava2.4.0 · 1×
chalk3.0.0 · 1×
copyfiles2.1.1 · 1×
debug4.1.1 · 1×
deepmerge4.2.2 · 1×
documentation-markdown-themes12.1.5 · 1×

For agents

$ claude mcp add puppeteer-extra \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact