diff options
| author | Igor Soarez <igor@soarez.org> | 2026-11-10 19:17:57 +0200 |
|---|---|---|
| committer | Igor Soarez <igor@soarez.org> | 2026-11-10 19:22:56 +0200 |
| commit | cf47a164991bf5588fd2b41ce244f55d900c1167 (patch) | |
| tree | d2fffa70d1fce92be5aaa2124ed77a6be2e0c3c0 /test-suite/challenges/25-pointer-continuity.html | |
| parent | b8b63ea4d1bad9c4bbac6b05b03cce5f2cfa3f94 (diff) | |
extension: snapshot sandboxed pages over CDP, never return empty text
On a page served with CSP `sandbox` and no allow-scripts, such as
raw.githubusercontent.com, chrome.scripting.executeScript runs nothing and
resolves with a null result instead of throwing. The access-denied CDP
fallback never ran, page.snapshot returned undefined, and chrome_snapshot
answered with {type: "text"} and no text, because JSON.stringify(undefined)
is undefined. Pi saved that block in the session, and every later turn
failed in token estimation with "Cannot read properties of undefined
(reading 'length')", whatever the provider.
When scripting resolves without an envelope, snapshot and inspect now
redo the injection and the call over CDP Runtime.evaluate, which such pages
still allow, and raise an error if that also returns nothing. On the pi
side, safeJson always returns a string, and an empty snapshot or inspect
result is a tool error rather than a text block without text.
sandboxed-snapshot.test.mjs drives page.snapshot and page.inspect through a
page that runs no extension script. It fails on b8b63ea.
Diffstat (limited to 'test-suite/challenges/25-pointer-continuity.html')
0 files changed, 0 insertions, 0 deletions
