Class: Selenium::DevTools::V85::HeadlessExperimental

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

Constant Summary collapse

EVENTS =
{
  needs_begin_frames_changed: 'needsBeginFramesChanged',
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ HeadlessExperimental

Returns a new instance of HeadlessExperimental.



29
30
31
# File 'lib/selenium/devtools/v85/headless_experimental.rb', line 29

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

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



38
39
40
41
42
43
44
# File 'lib/selenium/devtools/v85/headless_experimental.rb', line 38

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



46
47
48
# File 'lib/selenium/devtools/v85/headless_experimental.rb', line 46

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

#enableObject



50
51
52
# File 'lib/selenium/devtools/v85/headless_experimental.rb', line 50

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

#on(event, &block) ⇒ Object



33
34
35
36
# File 'lib/selenium/devtools/v85/headless_experimental.rb', line 33

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