mirror of
https://github.com/SawyerHood/dev-browser.git
synced 2026-09-20 13:44:44 +08:00
16dec89cfe
* doobie: skeleton — client, daemon, vm runner, page helpers, build Co-Authored-By: Claude <noreply@anthropic.com> * doobie: snapshot engine, waitForLoad, docs, tests, bench, Bun-native fast client Co-Authored-By: Claude <noreply@anthropic.com> * doobie: fix round 1 from adversarial review (transport backpressure, profiles per mode, page mutex, bringToFront, zombie runs, shot DPR, dialogs, snapshot names/frames/boxes, docs) Co-Authored-By: Claude <noreply@anthropic.com> * docs: handoff notes Co-Authored-By: Claude <noreply@anthropic.com> * launch: mark clean exit to skip session restore, cache --no-sandbox; untrack build artifact Co-Authored-By: Claude <noreply@anthropic.com> * snapshot: drop [cursor=pointer] on inherently interactive roles, no row content names (HN interactive 29k -> 21k chars) Co-Authored-By: Claude <noreply@anthropic.com> * ci: bench tolerance on shared runners; release: npm publish only with NPM_TOKEN Co-Authored-By: Claude <noreply@anthropic.com> * mcp: stdio MCP server over the daemon frames (doobie mcp); ci: explicit test timeout Co-Authored-By: Claude <noreply@anthropic.com> * docs: bb integration note (socket source contract) Co-Authored-By: Claude <noreply@anthropic.com> * fix round 2: front lock (no stale cache), run gate covers handles/frames/popups, --connect extends only touched tabs, doobie chrome verifies launch, self-healing shim + devDependencies, snapshot name fallbacks/pointer inheritance/shadow refs, docs Co-Authored-By: Claude <noreply@anthropic.com> * daemon: drain active requests before exit; tests: realpath-safe and node-optional packaging tests; chrome: share sandbox helpers Co-Authored-By: Claude <noreply@anthropic.com> * relative file paths resolve against the caller's cwd; readFile("downloads/<name>"); TimeoutError for ref waits Co-Authored-By: Claude <noreply@anthropic.com> * runtime: share host Error constructors with the script realm Co-Authored-By: Claude <noreply@anthropic.com> * shim: sh/JS polyglot so bun-only machines run it; v0.1.1 Co-Authored-By: Claude <noreply@anthropic.com> * launch: automation profile prefs (leak-detection dialog off, no password/autofill UI) — fixes dead input after logins in new headless Co-Authored-By: Claude <noreply@anthropic.com> * v0.1.2 Co-Authored-By: Claude <noreply@anthropic.com> * client: retry when racing a shutting-down daemon (flaky stop/status on CI) Co-Authored-By: Claude <noreply@anthropic.com> * feat!: make doobie the dev-browser 1.0 runtime * ci: use Node 24 GitHub actions * fix: isolate authenticated CDP sessions * fix: close run gate escape paths * fix: preserve UTF-8 across protocol chunks * test: stabilize browser context gate coverage * test: isolate browser context gate coverage --------- Co-authored-by: Sawyer Hood <kirbyhood@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
38 lines
1.5 KiB
JavaScript
Executable File
38 lines
1.5 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
// npm postinstall: download the dev-browser binary for this platform from GitHub
|
|
// Releases (or DEV_BROWSER_DOWNLOAD_BASE), verify its SHA-256 against the
|
|
// release's SHA256SUMS, and for a global install (best effort) point the
|
|
// global `dev-browser` symlink straight at the binary. Never fails the install:
|
|
// bin/dev-browser.cjs downloads on first run if this step was skipped or blocked
|
|
// (bun, pnpm, --ignore-scripts, offline).
|
|
"use strict";
|
|
const fs = require("node:fs");
|
|
const dl = require("./download-binary.cjs");
|
|
|
|
if (process.env.DEV_BROWSER_SKIP_DOWNLOAD) {
|
|
console.log("dev-browser: DEV_BROWSER_SKIP_DOWNLOAD set, not downloading the binary");
|
|
process.exit(0);
|
|
}
|
|
// Dev checkout (source present): nothing to download; the shim runs src/ with bun.
|
|
if (fs.existsSync(dl.devEntry)) {
|
|
process.exit(0);
|
|
}
|
|
|
|
const plat = dl.platformAsset();
|
|
if (plat.error) {
|
|
// package.json has no "os" field on purpose: this soft message is the only gate.
|
|
console.warn(`dev-browser: ${plat.error}; \`dev-browser\` will not work on this machine.`);
|
|
process.exit(0);
|
|
}
|
|
|
|
dl.downloadBinary({ log: (m) => console.log(m) })
|
|
.then(() => {
|
|
dl.relinkGlobal({ log: (m) => console.log(m) });
|
|
})
|
|
.catch((err) => {
|
|
console.warn(`dev-browser: could not download the binary (${err.message}).`);
|
|
console.warn("dev-browser: the `dev-browser` command will retry the download on first run. To fix it now:");
|
|
console.warn(dl.manualHint());
|
|
process.exit(0);
|
|
});
|