Skip to content

v1.2.0 — attach to a running browser, evaluate(fn), same-document goto fix

Choose a tag to compare

@acunningham-ship-it acunningham-ship-it released this 26 Jul 18:06

Published to npm as @achamm/veilbrowser@1.2.0.

Added

  • Browser.connect(endpoint) + browser.pages() — drive an already-running Chrome. Chrome locks a user-data-dir, so the profile holding your real logged-in sessions can't be opened by a second instance; previously the only options were killing the browser holding it or copying the profile and losing the session. This is what makes the sites that matter reachable, because Google, Reddit, Meta and TikTok score the session, not the IP. close() on an attached browser detaches only — it never kills a process it didn't start.
  • evaluate() accepts a function, not just a string. evaluate(() => document.title) used to stringify to a function object that returnByValue can't serialise, so CDP replied -32602 — an error indistinguishable from a protocol regression.

Fixed

  • goto() no longer hangs on a same-document navigation. A #fragment (or any history/pushState nav) loads no new document, so Page.loadEventFired never fires and the waiter ran to the full timeout. Measured on Chrome 150: 15,001 ms for a fragment vs ~300 ms for a real navigation. Now races Page.navigatedWithinDocument against the load waiter. Verified non-vacuous: an unresolvable host still rejects in 80 ms, a 404 still reports 404.

Full notes in CHANGELOG.md.