Class: Selenium::DevTools::V85::Browser

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

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ Browser

Returns a new instance of Browser.



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

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#closeObject



62
63
64
# File 'lib/selenium/devtools/v85/browser.rb', line 62

def close
  @devtools.send_cmd('Browser.close')
end

#crashObject



66
67
68
# File 'lib/selenium/devtools/v85/browser.rb', line 66

def crash
  @devtools.send_cmd('Browser.crash')
end

#crash_gpu_processObject



70
71
72
# File 'lib/selenium/devtools/v85/browser.rb', line 70

def crash_gpu_process
  @devtools.send_cmd('Browser.crashGpuProcess')
end

#get_browser_command_lineObject



78
79
80
# File 'lib/selenium/devtools/v85/browser.rb', line 78

def get_browser_command_line
  @devtools.send_cmd('Browser.getBrowserCommandLine')
end

#get_histogram(name:, delta: nil) ⇒ Object



88
89
90
91
92
# File 'lib/selenium/devtools/v85/browser.rb', line 88

def get_histogram(name:, delta: nil)
  @devtools.send_cmd('Browser.getHistogram',
                     name: name,
                     delta: delta)
end

#get_histograms(query: nil, delta: nil) ⇒ Object



82
83
84
85
86
# File 'lib/selenium/devtools/v85/browser.rb', line 82

def get_histograms(query: nil, delta: nil)
  @devtools.send_cmd('Browser.getHistograms',
                     query: query,
                     delta: delta)
end

#get_versionObject



74
75
76
# File 'lib/selenium/devtools/v85/browser.rb', line 74

def get_version
  @devtools.send_cmd('Browser.getVersion')
end

#get_window_bounds(window_id:) ⇒ Object



94
95
96
97
# File 'lib/selenium/devtools/v85/browser.rb', line 94

def get_window_bounds(window_id:)
  @devtools.send_cmd('Browser.getWindowBounds',
                     windowId: window_id)
end

#get_window_for_target(target_id: nil) ⇒ Object



99
100
101
102
# File 'lib/selenium/devtools/v85/browser.rb', line 99

def get_window_for_target(target_id: nil)
  @devtools.send_cmd('Browser.getWindowForTarget',
                     targetId: target_id)
end

#grant_permissions(permissions:, origin: nil, browser_context_id: nil) ⇒ Object



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

def grant_permissions(permissions:, origin: nil, browser_context_id: nil)
  @devtools.send_cmd('Browser.grantPermissions',
                     permissions: permissions,
                     origin: origin,
                     browserContextId: browser_context_id)
end

#on(event, &block) ⇒ Object



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

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

#reset_permissions(browser_context_id: nil) ⇒ Object



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

def reset_permissions(browser_context_id: nil)
  @devtools.send_cmd('Browser.resetPermissions',
                     browserContextId: browser_context_id)
end

#set_dock_tile(badge_label: nil, image: nil) ⇒ Object



110
111
112
113
114
# File 'lib/selenium/devtools/v85/browser.rb', line 110

def set_dock_tile(badge_label: nil, image: nil)
  @devtools.send_cmd('Browser.setDockTile',
                     badgeLabel: badge_label,
                     image: image)
end

#set_download_behavior(behavior:, browser_context_id: nil, download_path: nil) ⇒ Object



55
56
57
58
59
60
# File 'lib/selenium/devtools/v85/browser.rb', line 55

def set_download_behavior(behavior:, browser_context_id: nil, download_path: nil)
  @devtools.send_cmd('Browser.setDownloadBehavior',
                     behavior: behavior,
                     browserContextId: browser_context_id,
                     downloadPath: download_path)
end

#set_permission(permission:, setting:, origin: nil, browser_context_id: nil) ⇒ Object



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

def set_permission(permission:, setting:, origin: nil, browser_context_id: nil)
  @devtools.send_cmd('Browser.setPermission',
                     permission: permission,
                     setting: setting,
                     origin: origin,
                     browserContextId: browser_context_id)
end

#set_window_bounds(window_id:, bounds:) ⇒ Object



104
105
106
107
108
# File 'lib/selenium/devtools/v85/browser.rb', line 104

def set_window_bounds(window_id:, bounds:)
  @devtools.send_cmd('Browser.setWindowBounds',
                     windowId: window_id,
                     bounds: bounds)
end