{"_id":"@accesslint/chrome","_rev":"4-f1bb9683fb95cb636badff6dffe59825","name":"@accesslint/chrome","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@accesslint/chrome","version":"0.1.0","license":"MIT","_id":"@accesslint/chrome@0.1.0","maintainers":[{"name":"ckundo","email":"cameron@accesslint.com"}],"homepage":"https://github.com/AccessLint/accesslint#readme","bugs":{"url":"https://github.com/AccessLint/accesslint/issues"},"bin":{"accesslint-chrome":"dist/cli.js"},"dist":{"shasum":"5014a096ea8d060e29bc8b7f94d1a4f3538bf9a7","tarball":"https://registry.npmjs.org/@accesslint/chrome/-/chrome-0.1.0.tgz","fileCount":6,"integrity":"sha512-ZBYyZ17Q40anD4mPwa+zmBbwSA7sOj4DGhGvSW0Qa8TMBty+mPFD27r62KXc+bDVDHy9Sdro82Ldku/zDy1hfw==","signatures":[{"sig":"MEUCIQCdxmb0LvOlSrG7C5LCrN6cH/j3lnwvOm+e5pw2wm/w0AIgGWE0a9gXFbxZ6on2EcWtfdc5XUDBVn9z+jkgTmbdIMU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":132924},"type":"module","exports":{".":"./dist/chrome.js"},"gitHead":"b8778c608ba2ffb97e5f46b5afd3b8bf89be1e2e","scripts":{"dev":"bun src/cli.ts","test":"vitest run","build":"tsdown","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"ckundo","email":"cameron@accesslint.com"},"repository":{"url":"git+https://github.com/AccessLint/accesslint.git","type":"git","directory":"chrome"},"_npmVersion":"11.9.0","description":"Ensure a debuggable Chrome that serves the CDP HTTP discovery API, and manage its lifecycle. Launches detached so it outlives the launcher process; exposes ensure/stop/status.","directories":{},"_nodeVersion":"24.14.0","dependencies":{"chrome-launcher":"^1.2.1"},"_hasShrinkwrap":false,"devDependencies":{"citty":"^0.1.6","tsdown":"^0.21.9","vitest":"^4.1.4","typescript":"^5.7.0","@types/node":"^25.3.0"},"_npmOperationalInternal":{"tmp":"tmp/chrome_0.1.0_1780360473297_0.8318174801754354","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@accesslint/chrome","version":"0.1.1","license":"MIT","_id":"@accesslint/chrome@0.1.1","maintainers":[{"name":"ckundo","email":"cameron@accesslint.com"}],"homepage":"https://github.com/AccessLint/accesslint#readme","bugs":{"url":"https://github.com/AccessLint/accesslint/issues"},"bin":{"accesslint-chrome":"dist/cli.js"},"dist":{"shasum":"f3d346cf12fab0dc18815e4e8241a3d753fd1513","tarball":"https://registry.npmjs.org/@accesslint/chrome/-/chrome-0.1.1.tgz","fileCount":6,"integrity":"sha512-XH4nFlk7En99wSW1xg0dnEi9+0c2+MmJ0WMOCPl5Vujg25wIGzEPqgL3EFEKyN+4ZT3vdGWCG5yLsgaHeqfr4Q==","signatures":[{"sig":"MEYCIQCDn4CtMZrFSpqWfkbY8z2CDQZaZ7daGaJW8ODFCj3oCQIhAMj94AtkxJKew5aNL3lZdfsPXQACvE/wpqgUbuQZoUmQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@accesslint%2fchrome@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":132924},"type":"module","exports":{".":"./dist/chrome.js"},"gitHead":"38caf51a1fd64b6aa2914cb725f1bcaac1e9870e","scripts":{"dev":"bun src/cli.ts","test":"vitest run","build":"tsdown","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:45b4bb55-5e4c-4a3f-b4b6-f16c9e00d4da"}},"repository":{"url":"git+https://github.com/AccessLint/accesslint.git","type":"git","directory":"chrome"},"_npmVersion":"11.13.0","description":"Ensure a debuggable Chrome that serves the CDP HTTP discovery API, and manage its lifecycle. Launches detached so it outlives the launcher process; exposes ensure/stop/status.","directories":{},"_nodeVersion":"24.16.0","dependencies":{"chrome-launcher":"^1.2.1"},"_hasShrinkwrap":false,"devDependencies":{"citty":"^0.1.6","tsdown":"^0.21.9","vitest":"^4.1.4","typescript":"^5.7.0","@types/node":"^25.3.0"},"_npmOperationalInternal":{"tmp":"tmp/chrome_0.1.1_1780362529364_0.8425205822545567","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@accesslint/chrome","version":"0.1.2","license":"MIT","_id":"@accesslint/chrome@0.1.2","maintainers":[{"name":"ckundo","email":"cameron@accesslint.com"}],"homepage":"https://github.com/AccessLint/accesslint#readme","bugs":{"url":"https://github.com/AccessLint/accesslint/issues"},"bin":{"accesslint-chrome":"dist/cli.js"},"dist":{"shasum":"1d25f8058e54c32f4fbdd43ab149c51e238a487b","tarball":"https://registry.npmjs.org/@accesslint/chrome/-/chrome-0.1.2.tgz","fileCount":6,"integrity":"sha512-uZpjnh7NOWMhuamAV4+uZzIIDTKM9X8QC9IH8kBOmhQueLq/k0SqwDc1YMGsMwBcu981vT1/jY/thgO4OHmalg==","signatures":[{"sig":"MEYCIQCpq/TljgYSwBp2bj34bImK/dhc2ydknJ7TimzjrmluRQIhAIpXjlHifvQem3I3CWifexbXkh2VLwZsziHbIpJ1Yfvt","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@accesslint%2fchrome@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":134737},"type":"module","exports":{".":"./dist/chrome.js"},"gitHead":"2abed8f67a052a2322e66b1ae78741370ce97c55","scripts":{"dev":"bun src/cli.ts","test":"vitest run","build":"tsdown","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:45b4bb55-5e4c-4a3f-b4b6-f16c9e00d4da"}},"repository":{"url":"git+https://github.com/AccessLint/accesslint.git","type":"git","directory":"chrome"},"_npmVersion":"11.13.0","description":"Ensure a debuggable Chrome that serves the CDP HTTP discovery API, and manage its lifecycle. Launches detached so it outlives the launcher process; exposes ensure/stop/status.","directories":{},"_nodeVersion":"24.16.0","dependencies":{"chrome-launcher":"^1.2.1"},"_hasShrinkwrap":false,"devDependencies":{"citty":"^0.1.6","tsdown":"^0.21.9","vitest":"^4.1.4","typescript":"^5.7.0","@types/node":"^25.3.0"},"_npmOperationalInternal":{"tmp":"tmp/chrome_0.1.2_1780366551165_0.17068320417614458","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@accesslint/chrome","version":"0.2.0","description":"Ensure a debuggable Chrome that serves the CDP HTTP discovery API, and manage its lifecycle. Launches detached so it outlives the launcher process; exposes ensure/stop/status.","repository":{"type":"git","url":"git+https://github.com/AccessLint/accesslint.git","directory":"chrome"},"type":"module","bin":{"accesslint-chrome":"dist/cli.js"},"exports":{".":"./dist/chrome.js"},"scripts":{"build":"tsdown","typecheck":"tsc --noEmit","dev":"bun src/cli.ts","test":"vitest run","prepublishOnly":"bun run build"},"dependencies":{"@puppeteer/browsers":"^3.0.4","chrome-launcher":"^1.2.1"},"devDependencies":{"@types/node":"^25.3.0","citty":"^0.1.6","tsdown":"^0.21.9","typescript":"^5.7.0","vitest":"^4.1.4"},"license":"MIT","gitHead":"2f9d9f0dd4bf504b33b4d9784f5f6edc7a4b6579","_id":"@accesslint/chrome@0.2.0","bugs":{"url":"https://github.com/AccessLint/accesslint/issues"},"homepage":"https://github.com/AccessLint/accesslint#readme","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-rLTzvBxLzaclO85qOomtGNukoaKrLIqWRYKzIZaIs4D/Dn1ej0dPdgPCLABNEnTVMbTnu2w71GsalH6XXMRn/A==","shasum":"4f4bbb451f2f88375f05bbdc5f9f1253b076d641","tarball":"https://registry.npmjs.org/@accesslint/chrome/-/chrome-0.2.0.tgz","fileCount":6,"unpackedSize":139172,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@accesslint%2fchrome@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICowkd332ijpD1aoZvLGVduSmxDNYcDAjYwdEpj7mPVMAiBv2IRa7qvzHUbhmUbHOh0yVMsD9YuQs7qC0oPtUMXneg=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:45b4bb55-5e4c-4a3f-b4b6-f16c9e00d4da"}},"directories":{},"maintainers":[{"name":"ckundo","email":"cameron@accesslint.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chrome_0.2.0_1780367578831_0.27687776870868386"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-02T00:34:33.153Z","modified":"2026-06-02T02:32:59.231Z","0.1.0":"2026-06-02T00:34:33.439Z","0.1.1":"2026-06-02T01:08:49.517Z","0.1.2":"2026-06-02T02:15:51.309Z","0.2.0":"2026-06-02T02:32:58.971Z"},"bugs":{"url":"https://github.com/AccessLint/accesslint/issues"},"license":"MIT","homepage":"https://github.com/AccessLint/accesslint#readme","repository":{"type":"git","url":"git+https://github.com/AccessLint/accesslint.git","directory":"chrome"},"description":"Ensure a debuggable Chrome that serves the CDP HTTP discovery API, and manage its lifecycle. Launches detached so it outlives the launcher process; exposes ensure/stop/status.","maintainers":[{"name":"ckundo","email":"cameron@accesslint.com"}],"readme":"# @accesslint/chrome\n\nEnsure a **debuggable Chrome** that AccessLint's live-DOM audits can drive, and\nmanage its lifecycle.\n\nThe AccessLint CLI (`@accesslint/cli`) is a pure CDP client: give it a debug\nendpoint and a URL, and it injects `@accesslint/core` and audits. It does not\nlaunch Chrome. This package fills that gap — and launches Chrome **detached** so\nit outlives the one-shot launcher process that started it.\n\n## Why a separate package\n\n`chrome-launcher`'s `launch()` ties Chrome's lifetime to the calling process,\nwhich is wrong for a `npx`-style one-shot: when the command exits, Chrome would\ndie before the audit connects. So this package spawns Chrome detached, records\nits pid + throwaway profile to a state file, and exposes explicit `stop`.\n\nIt also encodes the **HTTP-discovery trap**: a Chrome opened via the DevTools\ncheckbox (or `chrome-devtools-mcp`) holds the debug port open but serves only a\nWebSocket — `chrome-remote-interface` can't drive it. This package treats a\nChrome as usable only when `/json/version` answers, never on a bare TCP probe.\nWhen you pin a port (`--port` or `ACCESSLINT_CDP_PORT`) it fails if that port is\nsquatted, so callers stay pointed at the port they asked for; an unpinned\n`ensure` steps to the next free port instead.\n\n## Usage\n\n```bash\n# Get-or-launch a driveable Chrome; prints its endpoint as JSON.\nnpx @accesslint/chrome ensure\n# → {\"ok\":true,\"mode\":\"launched\",\"host\":\"127.0.0.1\",\"port\":9222,\"pid\":1234,\"managed\":true,...}\n\n# Idempotent: a second ensure attaches to the running one.\nnpx @accesslint/chrome ensure        # → {\"mode\":\"attached\",...}\n\n# Tear it down.\nnpx @accesslint/chrome stop --all\n```\n\n### Commands\n\n| Command  | What it does                                                              |\n| -------- | ------------------------------------------------------------------------- |\n| `ensure` | Attach to a driveable Chrome on the port, or launch a detached one.       |\n| `stop`   | Kill a managed instance (`--port`) or all of them (`--all`) and clean up. |\n\n### Options\n\n```\n-p, --port <n>   CDP port to attach to / launch on (default 9222)\n    --headed     Launch a visible Chrome instead of headless (ensure)\n    --download   Download a managed Chrome for Testing if none is installed (ensure)\n    --all        Stop every managed instance (stop)\n```\n\nIf the default port is occupied by an **undriveable** Chrome (checkbox mode),\nan unpinned `ensure` steps to a free port and reports the actual one — read\n`port` from its JSON output. If you pinned that port with `--port`, `ensure`\nfails instead; free the port or pass a different one.\n\nBy default `ensure` uses the system Chrome (`CHROME_PATH` or a platform search)\nand fails if none is found. Pass `--download` (or set `ACCESSLINT_CHROME_DOWNLOAD=1`)\nto fall back to a pinned **Chrome for Testing** build fetched via\n`@puppeteer/browsers` into a cache dir. The download (~170MB) happens once on\nfirst use; later runs reuse the cached binary. A system Chrome, when present,\nalways wins — the download is only a fallback.\n\n### Environment\n\n```\nACCESSLINT_CDP_PORT         default port\nCHROME_PATH                 override Chrome binary discovery\nACCESSLINT_CHROME_DOWNLOAD   1/true to enable the Chrome for Testing fallback\nACCESSLINT_CHROME_CACHE_DIR  where downloaded Chrome is cached (default ~/.cache/accesslint-chrome)\n```\n\n## Library API\n\n```ts\nimport { ensure, stop } from \"@accesslint/chrome\";\n\nconst chrome = await ensure({ port: 9222 }); // { mode, host, port, pid, managed, ... }\n// … run an audit against chrome.host:chrome.port …\nawait stop({ port: chrome.port });\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}