Class: Selenium::DevTools::V130::Inspector
- Inherits:
-
Object
- Object
- Selenium::DevTools::V130::Inspector
- Defined in:
- lib/selenium/devtools/v130/inspector.rb
Constant Summary collapse
- EVENTS =
{ detached: 'detached', target_crashed: 'targetCrashed', target_reloaded_after_crash: 'targetReloadedAfterCrash', }.freeze
Instance Method Summary collapse
- #disable ⇒ Object
- #enable ⇒ Object
-
#initialize(devtools) ⇒ Inspector
constructor
A new instance of Inspector.
- #on(event, &block) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ Inspector
Returns a new instance of Inspector.
31 32 33 |
# File 'lib/selenium/devtools/v130/inspector.rb', line 31 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#disable ⇒ Object
40 41 42 |
# File 'lib/selenium/devtools/v130/inspector.rb', line 40 def disable @devtools.send_cmd('Inspector.disable') end |
#enable ⇒ Object
44 45 46 |
# File 'lib/selenium/devtools/v130/inspector.rb', line 44 def enable @devtools.send_cmd('Inspector.enable') end |
#on(event, &block) ⇒ Object
35 36 37 38 |
# File 'lib/selenium/devtools/v130/inspector.rb', line 35 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["Inspector.#{event}"] << block end |