fix: persist auth cookies on close in native mode (#650)

This commit is contained in:
Chris Tate
2026-03-06 12:46:03 -06:00
committed by GitHub
parent 492830accb
commit b7e7a2548e
3 changed files with 143 additions and 2 deletions
+13 -2
View File
@@ -146,6 +146,13 @@ impl BrowserProcess {
BrowserProcess::Lightpanda(p) => p.kill(),
}
}
pub fn wait_or_kill(&mut self, timeout: std::time::Duration) {
match self {
BrowserProcess::Chrome(p) => p.wait_or_kill(timeout),
BrowserProcess::Lightpanda(p) => p.kill(),
}
}
}
pub struct BrowserManager {
@@ -583,8 +590,12 @@ impl BrowserManager {
.send_command_no_params("Browser.close", None)
.await;
if let Some(ref mut process) = self.browser_process {
process.kill();
if let Some(mut process) = self.browser_process.take() {
let timeout = std::time::Duration::from_secs(5);
let _ = tokio::task::spawn_blocking(move || {
process.wait_or_kill(timeout);
})
.await;
}
Ok(())