Skip to content

fix: resume and detach from targets we don't track - #623

Merged
route merged 2 commits into
mainfrom
fix/untracked-target-leak
Aug 29, 2026
Merged

route merged 2 commits into
mainfrom
fix/untracked-target-leak

Conversation

@route

@route route commented Aug 29, 2026

Copy link
Copy Markdown
Member

Contexts::ALLOWED_TARGET_TYPES excludes browser_ui, but auto-attach is armed with waitForDebuggerOnStart: true. Every target Chrome attaches starts paused.

Chrome 152 opens two chrome://omnibox-popup.top-chrome/ (browser_ui) targets per browser context, so a plain Ferrum::Browser.new leaks two sessions and each extra context adds two more.

Untracked targets now go through detach_untracked, which resumes the debugger and drops the session — the same treatment service workers already get.

Auto-attach starts every target paused, and the attach handler skipped
types outside `ALLOWED_TARGET_TYPES` before anything resumed them, so
Chrome's two `browser_ui` targets per browser context stayed attached and
paused for the lifetime of the browser.
@route
route force-pushed the fix/untracked-target-leak branch from 19b6d4c to 61c1e12 Compare August 29, 2026 09:29
@route
route merged commit 267dabf into main Aug 29, 2026
7 checks passed
@route
route deleted the fix/untracked-target-leak branch August 29, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant