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
8 changes: 2 additions & 6 deletions lib/ferrum/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,6 @@ def activate
# @param [String] method
# The CDP method name, e.g. `"Page.navigate"`.
#
# @param [Boolean] slowmoable
# Whether to sleep for `Browser::Options#slowmo` seconds before sending
# the command.
#
# @param [Numeric, Deadline, nil] timeout
# Overrides the timeout this command's response is bound by. Defaults
# to the page's `timeout`. Callers with their own budget (e.g. `#pdf`/
Expand All @@ -416,10 +412,10 @@ def activate
# @example
# page.command("Runtime.evaluate", expression: "1 + 1")
#
def command(method, slowmoable: false, timeout: nil, **params)
def command(method, timeout: nil, **params)
raise ArgumentError, "wait: is removed, wrap #{method} in await_navigation instead" if params.key?(:wait)

sleep(@options.slowmo) if slowmoable && @options.slowmo.positive?
sleep(@options.slowmo) if params.delete(:slowmoable) && @options.slowmo.positive?
client.command(method, timeout: Deadline.wrap(timeout || self.timeout), **params)
end

Expand Down
4 changes: 4 additions & 0 deletions lib/ferrum/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ def command(method, timeout: nil, **params)

# Workers have a single execution context and no navigable document, so
# there's nothing for {Network} to check requests against.
#
# @return [nil]
#
# @api private
def main_frame
nil
end
Expand Down
2 changes: 1 addition & 1 deletion sig/ferrum/page.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module Ferrum

def window_id: () -> ::Integer

def command: (String method, ?slowmoable: bool, ?timeout: (::Numeric | Deadline)?, **untyped) -> Hash[String, untyped]
def command: (String method, ?timeout: (::Numeric | Deadline)?, **untyped) -> Hash[String, untyped]

def on: (:dialog) { (Dialog) -> void } -> Integer
| (:console) { (Console::Message) -> void } -> Integer
Expand Down
Loading