pi-browser-harness 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to pi-browser-harness will be documented in this file.
4
4
 
5
+ ## 0.10.2 — 2026-07-26
6
+
7
+ ### Fixed
8
+
9
+ - **Page info no longer fails on a missing `documentElement`.** The page-info probe read `document.documentElement.scrollWidth`/`scrollHeight` directly, which throws when `documentElement` is absent — leaving every caller with an evaluation error instead of a page snapshot. The probe now falls back to zeroed scroll dimensions and returns a usable `PageInfo`.
10
+
5
11
  ## 0.10.1 — 2026-07-26
6
12
 
7
13
  ### Fixed
package/README.md CHANGED
@@ -50,9 +50,9 @@ The first time you connect, you'll be asked which browser profile the agent shou
50
50
 
51
51
  ```
52
52
  Select the browser profile the agent should use
53
- vertexcover.io (aman@vertexcover.io)
54
- ✓ Aman (personal@gmail.com)
55
- Harness (harness@gmail.com)
53
+ Work (work@example.com)
54
+ ✓ Personal (personal@example.com)
55
+ Testing (test@example.com)
56
56
  — Clear selection (use whichever window is focused) —
57
57
  ```
58
58
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-browser-harness",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "Browser control extension for pi — navigate, click, type, screenshot, and extract data from real Chrome via CDP",
5
5
  "keywords": [
6
6
  "pi-package",
package/src/client.ts CHANGED
@@ -256,7 +256,7 @@ export const createBrowserClient = (opts: BrowserClientOptions): BrowserClient =
256
256
  const currentTid = session.current()?.targetId;
257
257
  const cached = currentTid ? pageCaches.get(currentTid) : undefined;
258
258
  if (cached && !dirty && Date.now() - cached.at < PAGE_INFO_TTL_MS) return ok(cached.info);
259
- const expr = safeJs`JSON.stringify({url:location.href,title:document.title,w:innerWidth,h:innerHeight,sx:scrollX,sy:scrollY,pw:document.documentElement.scrollWidth,ph:document.documentElement.scrollHeight})`;
259
+ const expr = safeJs`JSON.stringify((function(){var e=document.documentElement||{scrollWidth:0,scrollHeight:0};return {url:location.href,title:document.title,w:innerWidth,h:innerHeight,sx:scrollX,sy:scrollY,pw:e.scrollWidth,ph:e.scrollHeight};})())`;
260
260
  const raw = await evaluateJs(expr);
261
261
  if (!raw.success) return raw;
262
262
  if (typeof raw.data !== "string") return err(cdpError("invalid_response", "page info evaluation did not return a string"));