Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

fix: return error when closing non-existent tab

Mariod05bce5d8c59
diff --git a/tab_manager.go b/tab_manager.go
index b9fd8fd1..57dc9a20 100644
--- a/tab_manager.go
+++ b/tab_manager.go
@@ -141,7 +141,7 @@ func (tm *TabManager) CloseTab(tabID string) error {
if err := target.CloseTarget(target.ID(tabID)).Do(cdp.WithExecutor(closeCtx, chromedp.FromContext(closeCtx).Browser)); err != nil {
if !tracked {
- return nil
+ return fmt.Errorf("tab %s not found", tabID)
}
slog.Debug("close target CDP", "tabId", tabID, "err", err)
}