Skip to content

fix: [#583] Don't raise timeout on lazy iframes#597

Merged
route merged 1 commit into
mainfrom
583-fix-lazy-iframes
Jul 6, 2026
Merged

fix: [#583] Don't raise timeout on lazy iframes#597
route merged 1 commit into
mainfrom
583-fix-lazy-iframes

Conversation

@route

@route route commented Jul 6, 2026

Copy link
Copy Markdown
Member

Chrome fires Page.frameAttached for every iframe in the DOM, but only fires Page.frameStoppedLoading for frames it actually loads. For a loading="lazy" iframe parked outside the viewport (e.g. inside a closed

Details, or injected by an inline <script> during page parse), Chrome never starts loading it, so it never transitions to :started_loading or :stopped_loading. It stays at state nil indefinitely. With this PR we are utilizing Page.setLifecycleEvents for frame network idle detection that helps to mark such frames as :stopped_loading.

Chrome fires `Page.frameAttached` for every iframe in the DOM, but only
fires `Page.frameStoppedLoading` for frames it actually loads. For a
loading="lazy" iframe parked outside the viewport (e.g. inside a closed
<details>, or injected by an inline <script> during page parse), Chrome
never starts loading it, so it never transitions to :started_loading or
:stopped_loading. It stays at state nil indefinitely. With this PR we
are utilizing `Page.setLifecycleEvents` for frame network idle
detection that helps to mark such frames as :stopped_loading.
@route route force-pushed the 583-fix-lazy-iframes branch from a999a17 to 885733a Compare July 6, 2026 13:35
@route route merged commit 0a492ef into main Jul 6, 2026
7 checks passed
@route route deleted the 583-fix-lazy-iframes branch July 6, 2026 13:42
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