Skip to content

Commit 5ca5e9e

Browse files
committed
fix: Page.frameStoppedLoading should not wait for document_node_id response
1 parent 11ccf79 commit 5ca5e9e

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
- `:ws_url` option is now used without modifications WYSIWYG.
1919
- `Network.requestWillBeSent` callback didn't handle params in a type-safe way
20+
- `Page.frameStoppedLoading` callback shouldn't wait for document_node_id response
2021

2122
### Removed
2223

lib/ferrum/page.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,9 @@ def use_authorized_proxy?
391391
use_proxy? && @proxy_user && @proxy_password
392392
end
393393

394-
def document_node_id
394+
def document_node_id(async: false)
395+
return client.command("DOM.getDocument", async: true, depth: 0) if async
396+
395397
command("DOM.getDocument", depth: 0).dig("root", "nodeId")
396398
end
397399

lib/ferrum/page/frames.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def subscribe_frame_stopped_loading
128128
# node will change the id and all subsequent nodes have to change id too.
129129
if @main_frame.id == params["frameId"]
130130
@event.set if idling?
131-
document_node_id
131+
document_node_id(async: true)
132132
end
133133

134134
frame = @frames[params["frameId"]]

0 commit comments

Comments
 (0)