Fix CDP click submit navigation parity (#69)

* 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]>
This commit is contained in:
Alexandr KondakovandSGavrl authored and GitHub committed 2026-05-15 20:38:54 +00:00
1 parent 3a6f3e6c22
commit 6dd1e4e65f
11 files changed
+450 -43

No files matched your search

+18 -2
View File
@@ -786,13 +786,14 @@ impl Page {
}
}
pub fn evaluate_for_cdp(
pub async fn evaluate_for_cdp(
&mut self,
expression: &str,
return_by_value: bool,
await_promise: bool,
) -> obscura_js::runtime::RemoteObjectInfo {
if let Some(js) = &mut self.js {
match js.evaluate_for_cdp(expression, return_by_value) {
match js.evaluate_for_cdp(expression, return_by_value, await_promise).await {
Ok(info) => info,
Err(e) => {
tracing::debug!("evaluate_for_cdp error: {}", e);
@@ -940,6 +941,21 @@ impl Page {
}
}
pub async fn process_pending_navigation(&mut self) -> Result<bool, PageError> {
if let Some((url, method, body)) = self.take_pending_navigation() {
self.navigate_with_wait_post(
&url,
crate::lifecycle::WaitUntil::Load,
&method,
&body,
)
.await?;
Ok(true)
} else {
Ok(false)
}
}
pub fn set_intercept_tx(&mut self, tx: tokio::sync::mpsc::UnboundedSender<obscura_js::ops::InterceptedRequest>) {
self.intercept_tx = Some(tx.clone());
if let Some(js) = &self.js {