fix: save_state captures cross-domain cookies and localStorage (#1064)

The Rust rewrite of save_state only captured cookies and localStorage
for the current page's origin, silently dropping cross-domain data
(e.g. SSO/CAS auth cookies). This was a regression from the JS version.

Cookies: replace Network.getCookies with Network.getAllCookies to
return cookies from all domains the browser has visited.

localStorage: track visited origins in BrowserManager during navigation,
then collect their localStorage via a temporary CDP target with Fetch
interception (serves blank HTML to avoid real network requests).

Co-authored-by: hyunjinee <leehj0110@kakao.com>
This commit is contained in:
jin.2
2026-03-28 13:41:53 -07:00
committed by GitHub
co-authored by hyunjinee
parent 747a3772e1
commit dc26ff7667
5 changed files with 414 additions and 42 deletions
+2
View File
@@ -1960,6 +1960,7 @@ async fn handle_close(state: &mut DaemonState) -> Result<Value, String> {
None,
Some(session_name.as_str()),
&state.session_id,
mgr.visited_origins(),
)
.await;
}
@@ -2996,6 +2997,7 @@ async fn handle_state_save(cmd: &Value, state: &DaemonState) -> Result<Value, St
path,
state.session_name.as_deref(),
&state.session_id,
mgr.visited_origins(),
)
.await?;