diff options
| author | Tianren Dong <tianrendong.dtr@gmail.com> | 2026-05-13 02:35:01 -0400 |
|---|---|---|
| committer | Tianren Dong <tianrendong.dtr@gmail.com> | 2026-05-13 02:35:01 -0400 |
| commit | 26ab0d36e45b1b65f667d4743eb30e83389ff57f (patch) | |
| tree | 678f92867c16671caa116b4e1762a672703f9863 /test-suite/challenges/33-network-console-capture.html | |
| parent | b319c82a75e9a6488a6454790d1436f74a655e7c (diff) | |
pi-chrome 0.14.2: recover from foreign-extension input overlays
When a different Chrome extension (password manager, autofill popup,
etc.) anchors an overlay to the focused input, Chrome's CDP refuses
our Input.dispatchMouseEvent with 'Cannot access a chrome-extension://
URL of different extension'. The CDP target list shows the foreign
chrome-extension:// URL as type:'other' attached to the same tab.
New behaviour in cdp() wrapper:
1. On that specific error for any Input.* call, snapshot CDP targets
to identify the offending extension id and log it (foreign-ext-
detected event added to ring buffer).
2. Send Esc via Input.dispatchKeyEvent (key dispatch routes by focus,
not coordinates, so it bypasses the overlay) to dismiss the popup.
3. Retry the original Input.* call once.
4. If retry still fails, throw a clear error naming the foreign
extension id and listing three concrete workarounds: disable that
extension on the page, use Tab-to-focus instead of clicking, or
run /chrome quiet off.
Diffstat (limited to 'test-suite/challenges/33-network-console-capture.html')
| -rw-r--r-- | test-suite/challenges/33-network-console-capture.html | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test-suite/challenges/33-network-console-capture.html b/test-suite/challenges/33-network-console-capture.html new file mode 100644 index 0000000..812345b --- /dev/null +++ b/test-suite/challenges/33-network-console-capture.html @@ -0,0 +1,33 @@ +<!doctype html> +<meta charset="utf-8"> +<title>33 network and console capture</title> +<link rel="stylesheet" href="../_style.css"> +<script src="../_lib.js"></script> +<body> +<main> + <p>Goal: click button. Page emits console messages and performs a fetch. Benchmark harness should verify <code>chrome_list_console_messages</code> and <code>chrome_list_network_requests</code> captured them.</p> + <button id="go" style="padding:16px 24px;font-size:18px">Emit console + fetch</button> + <pre id="rep" style="font:12px monospace;background:#111;color:#eee;padding:12px;border-radius:6px"></pre> +</main> +<script> +Challenge.init({ id: "network-console-capture", instructions: "clear capture, click, then inspect console/network tools" }); +document.getElementById("go").addEventListener("click", async (e) => { + console.log("pi-chrome-benchmark-console", { clicked: true, trusted: e.isTrusted }); + console.warn("pi-chrome-benchmark-warning"); + let data; + try { + const res = await fetch("data:application/json,%7B%22ok%22%3Atrue%2C%22source%22%3A%22pi-chrome-benchmark%22%7D"); + data = await res.json(); + } catch (err) { + return Challenge.fail("fetch failed: " + err.message); + } + document.getElementById("rep").textContent = JSON.stringify(data, null, 2); + Challenge.log("fetch-result", data); + if (data && data.ok && data.source === "pi-chrome-benchmark") { + Challenge.pass("page fetch completed; verify tool-level console/network capture separately"); + } else { + Challenge.fail("unexpected fetch payload: " + JSON.stringify(data)); + } +}); +</script> +</body> |
