* Fix Runtime.evaluate awaitPromise settling * Fix DOM event navigation side effects * Fix CDP click-triggered navigation parity * Strengthen CDP inline script click parity test * Handle positions-like submit URLs in CDP parity Co-authored-by: SGavrl <[email protected]>
1.6 KiB
1.6 KiB
Obscura inline script click-submit follow-up
Findings
- The existing CDP click-submit parity test was not strong enough to prove inline page scripts loaded by
Page.navigateexecuted in the document. - I updated
crates/obscura-cdp/tests/cdp_click_submit_parity.rsso the served page now includes an inline script with:- a global
function submitCompat() { location.href = '/submitted'; } - a real
document.querySelector('button').addEventListener('click', ...)handler that callssubmitCompat()
- a global
- The test now navigates with CDP
Page.navigate, verifiesRuntime.evaluatereportstypeof submitCompatasfunction, then obtains the real button element and invokesthis.click()throughRuntime.callFunctionOn. - After the click, the test asserts the page navigated to
/submittedand the body containssubmitted.
Changes made
- Strengthened
crates/obscura-cdp/tests/cdp_click_submit_parity.rsonly. - No production code changes were necessary: the strengthened regression test passes against the current implementation.
- SSRF/private-network behavior remains unchanged. The integration test continues to opt in with
OBSCURA_ALLOW_PRIVATE_NETWORK=1. - Did not touch positions.
Verification
cargo test -p obscura-cdp --test cdp_click_submit_parity -- --nocapturepassed.cargo testpassed.
Notes
- This validates inline script execution and real DOM click listener navigation at the direct CDP dispatch layer. If
/home/kcnc/.local/bin/obscura-cdp-clickstill fails against a live CDP server, the remaining gap is likely in the CLI/server/client path rather than inline script execution duringPage.navigateitself.