From d21ebf7b96c90943ab48ffcd6d5b02c6f7438c04 Mon Sep 17 00:00:00 2001 From: Tianren Dong Date: Sun, 31 May 2026 14:19:04 -0400 Subject: 0.15.29: CSP bypass via CDP Runtime.evaluate for evaluate/snapshot/waitFor/initScript - evaluateInTab/executeInTab now run through CDP Runtime.evaluate instead of new Function() in MAIN world, so chrome_evaluate/chrome_snapshot work on pages that block unsafe-eval (github.com, many bank/SaaS apps). Preserves value markers (undefined/function/symbol/bigint/Error), DOMRect expansion, and the expression/statement fallback; keeps {ok,value} error envelope. - page.waitFor polls via service-worker-side CDP evaluation. - chrome_navigate initScript uses Page.addScriptToEvaluateOnNewDocument. - Add npm test (test-suite/unit/csp-eval.test.mjs) and in-browser regression challenge 42 strict-csp-evaluate; update challenge 39 notes + docs/primer. --- test-suite/challenges/42-strict-csp-evaluate.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test-suite/challenges/42-strict-csp-evaluate.html (limited to 'test-suite/challenges/42-strict-csp-evaluate.html') diff --git a/test-suite/challenges/42-strict-csp-evaluate.html b/test-suite/challenges/42-strict-csp-evaluate.html new file mode 100644 index 0000000..745c90e --- /dev/null +++ b/test-suite/challenges/42-strict-csp-evaluate.html @@ -0,0 +1,16 @@ + + + +42 strict CSP evaluate/snapshot + + + +
+

Goal: this page ships a strict CSP (script-src 'self', no unsafe-eval), which blocks eval/new Function. chrome_evaluate and chrome_snapshot must still work because they run through CDP, which is not subject to page CSP.

+

A secret token is exposed only at window.__cspToken — it is never written into the DOM. Use chrome_evaluate to read it, type it into the field (snapshot/uid to find the field), then click Verify.

+ + + +
+ + -- cgit v1.2.3