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

@kvidzibo/pi-browser

v0.1.0

Published

Pi package: Patchright Chromium, headed Xvfb, isolated login profile, hard LAN block

Readme

pi-browser

Pi package. Agent-driven Chromium for pages that need JavaScript or a click path.

Driver is Patchright (Playwright fork): no Runtime.enable leak, no --enable-automation, navigator.webdriver patched. Default display is headed Xvfb on Linux. Prefers installed Google Chrome over bundled Chromium.

This is anti-automation hardening, not a captcha solver and not a residential-IP cloak. Datacenter IPs and Turnstile still lose. Prefer pi-web-access fetch_content for static public HTML.

| tool / command | job | |---|---| | browser | navigate, a11y snapshot, click/type/select, tabs, screenshot, close | | /browser status | mode, url, origin grants | | /browser mode xvfb\|headless\|host | display mode (host = your $DISPLAY) | | /browser login | isolated profile on your screen; you log in; then grant origins | | /browser logout | drop grants; next launch is ephemeral | | /browser close | kill Chromium + Xvfb |

Security: Pi packages run with your full system permissions. After /browser login, the agent can act as that site-user on granted origins. Page text is untrusted (prompt injection). Localhost, private IPs, file:, and your real Chrome/Chromium profile are out of reach on purpose. Tool results redact cookie values of 6+ characters and sensitive URL query keys; this is not a complete secret scanner. Install only from a source you trust.

Install

Need Google Chrome or Chromium. Optional on Linux: xvfb (headed virtual display — default when present).

pi install npm:@kvidzibo/pi-browser

Git:

pi install git:github.com/kvidzibo/[email protected]

Local checkout — Pi adds the path only; it does not run npm install for local sources:

cd /absolute/path/to/pi-browser
npm install --omit=peer
pi install /absolute/path/to/pi-browser

Do not also list this path in settings.json extensions — package load is enough.

Then /reload (or restart Pi).

Browser discovery, in order:

  1. PI_BROWSER_EXECUTABLE
  2. google-chrome / chrome / Edge on PATH (real Chrome preferred)
  3. chromium on PATH
  4. Patchright-cached Chromium (npx patchright install chromium)

Default mode: xvfb on Linux if Xvfb exists, else headless. host is slash-command only. The model cannot switch to host or login.

Cookies / login

Default profile is ephemeral. No import from ~/.config/chromium or Firefox.

/browser login opens an isolated profile at ~/.pi/agent/browser-profile (mode 0700) on your real display. You log in. Then you grant exact origins for this session. Reload, logout, and shutdown wipe grants. The profile dir can keep site cookies on disk; the agent still cannot navigate there without a fresh grant. Document navigations must match those origins. Other public hosts may still load as cookieless subresources (scripts, images, CDNs).

Do not type passwords into the browser tool.

Network gate

Every navigation and subresource is checked. Chromium traffic goes through a local pinning proxy: DNS is resolved, private answers are rejected, and the TCP connect uses the validated address (no second lookup). Blocked:

  • loopback, RFC1918, link-local, metadata, special-use
  • URL credentials
  • file:, javascript:, chrome:, devtools:
  • service workers, downloads, file choosers, JS dialogs (dismissed)

This is not a full intercepting proxy. WebRTC is disabled; residual DNS-rebinding / WebSocket risk remains.

Tests

npm test          # unit + factory load (needs `pi` on PATH)
npm run test:unit # no Pi required; this is what CI runs

No live browser in the default suite. Optional smoke:

BROWSER_LIVE=1 node --test --experimental-strip-types tests/live.test.ts

On a machine with Xvfb, headed smoke is:

BROWSER_LIVE=1 xvfb-run -a node --test --experimental-strip-types tests/live.test.ts