Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75bd1d21a7 | ||
|
|
06c75af46a |
Generated
+1
-1
@@ -45,7 +45,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "agent-browser-stealth"
|
name = "agent-browser-stealth"
|
||||||
version = "0.27.0-fork.23"
|
version = "0.27.0-fork.24"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes-gcm",
|
"aes-gcm",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "agent-browser-stealth"
|
name = "agent-browser-stealth"
|
||||||
version = "0.27.0-fork.23"
|
version = "0.27.0-fork.24"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Fast browser automation CLI for AI agents"
|
description = "Fast browser automation CLI for AI agents"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|||||||
@@ -672,7 +672,10 @@ impl DaemonState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let tab_id = mgr.assign_tab_id();
|
let tab_id = mgr.assign_tab_id();
|
||||||
mgr.add_page(super::browser::PageInfo {
|
// Passively discovered (event-driven) — must NOT steal the
|
||||||
|
// active tab, or a foreign/user/other-session tab opening
|
||||||
|
// hijacks this session's eval/screenshot target.
|
||||||
|
mgr.add_background_page(super::browser::PageInfo {
|
||||||
tab_id,
|
tab_id,
|
||||||
label: None,
|
label: None,
|
||||||
target_id: te.target_info.target_id.clone(),
|
target_id: te.target_info.target_id.clone(),
|
||||||
|
|||||||
@@ -1532,6 +1532,21 @@ impl BrowserManager {
|
|||||||
self.active_page_index = index;
|
self.active_page_index = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Add a passively-discovered page WITHOUT changing the active tab.
|
||||||
|
///
|
||||||
|
/// On a shared browser (ab-connect), `Target.targetCreated` events stream in
|
||||||
|
/// for tabs the user or OTHER agent sessions open. Those are drained on every
|
||||||
|
/// command; routing them through `add_page` made the active tab silently jump
|
||||||
|
/// to a foreign tab, so the session's own `eval`/`get title`/`screenshot`
|
||||||
|
/// landed on the wrong page. Passively-tracked pages must not steal focus —
|
||||||
|
/// only explicit opens (`tab new`, switch) set the active tab.
|
||||||
|
pub fn add_background_page(&mut self, page: PageInfo) {
|
||||||
|
if self.pages.iter().any(|p| p.target_id == page.target_id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.pages.push(page);
|
||||||
|
}
|
||||||
|
|
||||||
pub fn update_page_target_info(&mut self, target: &TargetInfo) -> bool {
|
pub fn update_page_target_info(&mut self, target: &TargetInfo) -> bool {
|
||||||
update_page_target_info_in_pages(&mut self.pages, target)
|
update_page_target_info_in_pages(&mut self.pages, target)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "agent-browser-stealth",
|
"name": "agent-browser-stealth",
|
||||||
"version": "0.27.0-fork.23",
|
"version": "0.27.0-fork.24",
|
||||||
"description": "Browser automation CLI for AI agents \u2014 stealth fork with anti-detection",
|
"description": "Browser automation CLI for AI agents \u2014 stealth fork with anti-detection",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"packageManager": "pnpm@11.1.3",
|
"packageManager": "pnpm@11.1.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user