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 +6 -0
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/client.ts +1 -1
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
|
-
|
|
54
|
-
✓
|
|
55
|
-
|
|
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
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:
|
|
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"));
|