Chrome DevTools Protocol sessions share active tab, causing automation jobs to read wrong pages
A developer discovered that multiple scheduled automation jobs sharing a single Chrome instance via the DevTools Protocol can silently read each other's pages without any errors or exceptions. The root cause is that named client sessions do not correspond to specific browser tabs — instead, every read targets whichever tab is currently active in the browser. When two jobs overlap, the last one to navigate claims the active tab for all sessions, causing other jobs to receive valid but incorrect page data. Two fixes exist: each job must explicitly re-assert its target tab before every command, or jobs must acquire an exclusive lock on the debugging port to prevent concurrent browser access. Both approaches have trade-offs, as the re-assertion method requires discipline across every command, while serialisation introduces idle wait time and lock-recovery complexity.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in