Skip to content

Commit

Permalink
[rb] Deprecate CDP methods on Firefox (#14763)
Browse files Browse the repository at this point in the history
* Deprecate CDP for firefox

* Make the deprecation message less generic
  • Loading branch information
aguspe authored Nov 21, 2024
1 parent b1828bf commit e9c09a2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ module HasLogEvents
#

def on_log_event(kind, &block)
if browser == :firefox
WebDriver.logger.deprecate(
'Driver#on_log_event on Firefox',
'the script.add_console_message_handler or the script.add_javascript_error_handler methods',
id: :on_log_event
)
end
raise Error::WebDriverError, "Don't know how to handle #{kind} events" unless KINDS.include?(kind)

enabled = log_listeners[kind].any?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ module HasNetworkInterception
#

def intercept(&)
if browser == :firefox
WebDriver.logger.deprecate(
'Driver#intercept on Firefox',
'the new bidi.network.add_intercept method',
id: :intercept
)
end
@interceptor ||= DevTools::NetworkInterceptor.new(devtools)
@interceptor.intercept(&)
end
Expand Down

0 comments on commit e9c09a2

Please sign in to comment.