Class: Selenium::DevTools::V131::HeadlessExperimental

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/devtools/v131/headless_experimental.rb

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ HeadlessExperimental

Returns a new instance of HeadlessExperimental.



26
27
28
# File 'lib/selenium/devtools/v131/headless_experimental.rb', line 26

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#begin_frame(frame_time_ticks: nil, interval: nil, no_display_updates: nil, screenshot: nil) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/selenium/devtools/v131/headless_experimental.rb', line 35

def begin_frame(frame_time_ticks: nil, interval: nil, no_display_updates: nil, screenshot: nil)
  @devtools.send_cmd('HeadlessExperimental.beginFrame',
                     frameTimeTicks: frame_time_ticks,
                     interval: interval,
                     noDisplayUpdates: no_display_updates,
                     screenshot: screenshot)
end

#disableObject



43
44
45
# File 'lib/selenium/devtools/v131/headless_experimental.rb', line 43

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

#enableObject



47
48
49
# File 'lib/selenium/devtools/v131/headless_experimental.rb', line 47

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

#on(event, &block) ⇒ Object



30
31
32
33
# File 'lib/selenium/devtools/v131/headless_experimental.rb', line 30

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