Class: Selenium::DevTools::V85::Inspector

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/devtools/v85/inspector.rb

Constant Summary collapse

EVENTS =
{
  detached: 'detached',
  target_crashed: 'targetCrashed',
  target_reloaded_after_crash: 'targetReloadedAfterCrash',
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ Inspector

Returns a new instance of Inspector.



31
32
33
# File 'lib/selenium/devtools/v85/inspector.rb', line 31

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#disableObject



40
41
42
# File 'lib/selenium/devtools/v85/inspector.rb', line 40

def disable
  @devtools.send_cmd('Inspector.disable')
end

#enableObject



44
45
46
# File 'lib/selenium/devtools/v85/inspector.rb', line 44

def enable
  @devtools.send_cmd('Inspector.enable')
end

#on(event, &block) ⇒ Object



35
36
37
38
# File 'lib/selenium/devtools/v85/inspector.rb', line 35

def on(event, &block)
  event = EVENTS[event] if event.is_a?(Symbol)
  @devtools.callbacks["Inspector.#{event}"] << block
end