This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. Always keep this file updated whenever there are changes that affect the documented commands, architecture, or key behaviors.
Simple Browser is a minimal Electron shell that launches a Chromium window with remote debugging enabled. It's published as an npm binary (simple-browser or browser) for quick browser automation and debugging use cases.
# Development (watches src/, auto-rebuilds, opens DevTools)
npm run dev
# Production-like launch
npm start
# Publish to npm
npm publish --access publicMain Process (src/main.ts)
- Configures Electron app with remote debugging on port 9222 (or next free port)
- Creates a maximized BrowserWindow with context isolation enabled
- Includes custom "Navigate..." dialog (Cmd/Ctrl+L) with inline HTML/CSS UI
- Uses
powerSaveBlockerto prevent display sleep - CLI args: last positional arg is URL to load, preceding args become Chromium switches
Preload (src/preload.ts)
- Minimal preload bridge using
contextBridge.exposeInMainWorld - Currently exports empty
electronBridgeobject
Build Output
- TypeScript compiles from
src/tobuild/ - The
runbash script handles CLI entry point, supportsstart/stopcommands for PM2 management
- Remote debugging port defaults to
REMOTE_DEBUGGING_PORTenv var or finds free port starting at 9222 - DevTools auto-opens in development (
NODE_ENV !== 'production') - No URL provided → opens the Chrome DevTools Protocol version endpoint