Recover DOM capture on documents that missed injection #286
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requestselenium-devtools-pyPython Selenium adapter for the DevTools dashboardPython Selenium adapter for the DevTools dashboard
Description
Activity
- addedselenium-devtools-pyPython Selenium adapter for the DevTools dashboardPython Selenium adapter for the DevTools dashboard
on Aug 12, 2026 Done in 70a6223 (#317), which arrived via a review comment on the preload PR rather than by picking this up — recording it here so nobody rebuilds it.
Both acceptance criteria are met:
- "A drain that finds no collector re-injects and retries once" —
pull_mutationsnow distinguishes the two failure modes the old code flattened together._READ_TRACE_SCRIPTanswersnullwhen the collector is absent from this document, which is the only signal that says so; a read that actually failed returns a separate_UNREADABLEsentinel and does not trigger recovery, because a dead session should not be re-injected into. Onnullit installs via the<script>path and reads once more. Mirrors core'sdrainCollectorWithRecovery, including recovering at drain time rather than at inject time — which costs nothing on the happy path, since the drain happens either way. - "Unit tested against a fake
execute_scriptthat reports a missing collector and then a present one" —test_the_drain_recovers_a_document_without_a_collectordrives exactly that fake, plustest_a_healthy_preloaded_document_is_not_reinstalledasserting a document that answers triggers no<script>at all.
Worth noting the gap this closed was wider than the issue described: the
<script>path never had drain-time recovery either, so this was not only a preload concern.- "A drain that finds no collector re-injects and retries once" —
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestselenium-devtools-pyPython Selenium adapter for the DevTools dashboardPython Selenium adapter for the DevTools dashboard
Part of #277
core's
drainCollectorWithRecoveryre-injects into the currentdocument when a drain finds no collector, then retries. Python has no equivalent,
so a document that missed injection contributes nothing and the actions on it
replay the previous page.
Acceptance criteria
A drain that finds no collector re-injects and retries
once, logging the recovery. Unit tested against a fake
execute_scriptthatreports a missing collector and then a present one.
Size: M. Depends on #284.