Class: Selenium::DevTools::V85::DOMSnapshot

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

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ DOMSnapshot

Returns a new instance of DOMSnapshot.



26
27
28
# File 'lib/selenium/devtools/v85/dom_snapshot.rb', line 26

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#capture_snapshot(computed_styles:, include_paint_order: nil, include_dom_rects: nil) ⇒ Object



51
52
53
54
55
56
# File 'lib/selenium/devtools/v85/dom_snapshot.rb', line 51

def capture_snapshot(computed_styles:, include_paint_order: nil, include_dom_rects: nil)
  @devtools.send_cmd('DOMSnapshot.captureSnapshot',
                     computedStyles: computed_styles,
                     includePaintOrder: include_paint_order,
                     includeDOMRects: include_dom_rects)
end

#disableObject



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

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

#enableObject



39
40
41
# File 'lib/selenium/devtools/v85/dom_snapshot.rb', line 39

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

#get_snapshot(computed_style_whitelist:, include_event_listeners: nil, include_paint_order: nil, include_user_agent_shadow_tree: nil) ⇒ Object



43
44
45
46
47
48
49
# File 'lib/selenium/devtools/v85/dom_snapshot.rb', line 43

def get_snapshot(computed_style_whitelist:, include_event_listeners: nil, include_paint_order: nil, include_user_agent_shadow_tree: nil)
  @devtools.send_cmd('DOMSnapshot.getSnapshot',
                     computedStyleWhitelist: computed_style_whitelist,
                     includeEventListeners: include_event_listeners,
                     includePaintOrder: include_paint_order,
                     includeUserAgentShadowTree: include_user_agent_shadow_tree)
end

#on(event, &block) ⇒ Object



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

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