Module: Selenium::WebDriver::DriverExtensions::HasLogEvents Private
- Includes:
- Atoms
- Defined in:
- rb/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- KINDS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
%i[console exception mutation].freeze
Instance Method Summary collapse
-
#on_log_event(kind, &block) {|| ... } ⇒ Object
private
Registers listener to be called whenever browser receives a new Console API message such as console.log() or an unhandled exception.
Methods included from Atoms
Instance Method Details
#on_log_event(kind, &block) {|| ... } ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Registers listener to be called whenever browser receives a new Console API message such as console.log() or an unhandled exception.
This currently relies on DevTools so is only supported in Chromium browsers.
59 60 61 62 63 64 65 66 67 68 |
# File 'rb/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb', line 59 def on_log_event(kind, &block) raise Error::WebDriverError, "Don't know how to handle #{kind} events" unless KINDS.include?(kind) enabled = log_listeners[kind].any? log_listeners[kind] << block return if enabled devtools.runtime.enable __send__(:"log_#{kind}_events") end |