Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
`go_to` instead

### Fixed
- `page.command(method, wait:)` ran a subclass override of `command`, like Cuprite's, twice
- `evaluate` of a result nested about 100 levels deep raised an opaque `BrowserError` about Chrome's CBOR stack limit,
it raises `ResultTooDeepError` now, a `BrowserError` that says to return less or use `evaluate_handle`
- `worker.close` never closed a dedicated worker, Chrome refuses to close it from outside, it closes itself now
Expand Down
13 changes: 6 additions & 7 deletions lib/ferrum/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -554,14 +554,13 @@ def activate
# page.command("Page.navigate", url: "https://github.com/")
#
def command(method, wait: 0, slowmoable: false, timeout: nil, **params)
if wait.positive?
result = nil
wait_for_navigation!(wait) { result = command(method, slowmoable:, timeout:, **params) }
return result
end

sleep(@options.slowmo) if slowmoable && @options.slowmo.positive?
client.command(method, timeout: timeout || self.timeout, **params)
timeout ||= self.timeout
return client.command(method, timeout:, **params) unless wait.positive?

result = nil
wait_for_navigation!(wait) { result = client.command(method, timeout:, **params) }
result
end

# Subscribes to a CDP event, or to `:dialog`, `:request`, `:response`,
Expand Down
Loading