Class: Selenium::WebDriver::BiDi::Protocol::Browser Private

Inherits:
Domain
  • Object
show all
Defined in:
lib/selenium/webdriver/bidi/protocol/browser.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Classes: DownloadBehavior, SetClientWindowStateParameters

Constant Summary collapse

CLIENT_WINDOW_INFO_STATE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{
  fullscreen: 'fullscreen',
  maximized: 'maximized',
  minimized: 'minimized',
  normal: 'normal'
}.freeze
CLIENT_WINDOW_NAMED_STATE_STATE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{
  fullscreen: 'fullscreen',
  maximized: 'maximized',
  minimized: 'minimized'
}.freeze
ClientWindowInfo =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  active: {wire_key: 'active', primitive: 'boolean'},
  client_window: {wire_key: 'clientWindow', primitive: 'string'},
  height: {wire_key: 'height', primitive: 'integer'},
  state: {wire_key: 'state', enum: 'Browser::CLIENT_WINDOW_INFO_STATE'},
  width: {wire_key: 'width', primitive: 'integer'},
  x: {wire_key: 'x', primitive: 'integer'},
  y: {wire_key: 'y', primitive: 'integer'}
)
UserContextInfo =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(user_context: {wire_key: 'userContext', primitive: 'string'})
CreateUserContextParameters =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  accept_insecure_certs: {wire_key: 'acceptInsecureCerts', required: false, primitive: 'boolean'},
  proxy: {wire_key: 'proxy', required: false, ref: 'Session::ProxyConfiguration'},
  unhandled_prompt_behavior: {
    wire_key: 'unhandledPromptBehavior',
    required: false,
    ref: 'Session::UserPromptHandler'
  }
)
GetClientWindowsResult =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  client_windows: {wire_key: 'clientWindows', ref: 'Browser::ClientWindowInfo', list: true}
)
GetUserContextsResult =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  user_contexts: {wire_key: 'userContexts', ref: 'Browser::UserContextInfo', list: true}
)
RemoveUserContextParameters =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  user_context: {wire_key: 'userContext', primitive: 'string'}
)
SetDownloadBehaviorParameters =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  download_behavior: {wire_key: 'downloadBehavior', nullable: true, ref: 'Browser::DownloadBehavior'},
  user_contexts: {wire_key: 'userContexts', required: false, list: true}
)

Instance Method Summary collapse

Methods inherited from Domain

#initialize

Constructor Details

This class inherits a constructor from Selenium::WebDriver::BiDi::Protocol::Domain

Instance Method Details

#closeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



167
168
169
# File 'lib/selenium/webdriver/bidi/protocol/browser.rb', line 167

def close
  execute(cmd: 'browser.close')
end

#create_user_context(accept_insecure_certs: Serialization::UNSET, proxy: Serialization::UNSET, unhandled_prompt_behavior: Serialization::UNSET) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/selenium/webdriver/bidi/protocol/browser.rb', line 174

def create_user_context(
  accept_insecure_certs: Serialization::UNSET,
  proxy: Serialization::UNSET,
  unhandled_prompt_behavior: Serialization::UNSET
)
  params = CreateUserContextParameters.new(
    accept_insecure_certs: accept_insecure_certs,
    proxy: proxy,
    unhandled_prompt_behavior: unhandled_prompt_behavior
  )
  execute(cmd: 'browser.createUserContext', params: params, result: Browser::UserContextInfo)
end

#download_behaviorObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



162
# File 'lib/selenium/webdriver/bidi/protocol/browser.rb', line 162

def download_behavior = DownloadBehavior

#get_client_windowsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



190
191
192
# File 'lib/selenium/webdriver/bidi/protocol/browser.rb', line 190

def get_client_windows
  execute(cmd: 'browser.getClientWindows', result: Browser::GetClientWindowsResult)
end

#get_user_contextsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



197
198
199
# File 'lib/selenium/webdriver/bidi/protocol/browser.rb', line 197

def get_user_contexts
  execute(cmd: 'browser.getUserContexts', result: Browser::GetUserContextsResult)
end

#remove_user_context(user_context:) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



204
205
206
207
# File 'lib/selenium/webdriver/bidi/protocol/browser.rb', line 204

def remove_user_context(user_context:)
  params = RemoveUserContextParameters.new(user_context: user_context)
  execute(cmd: 'browser.removeUserContext', params: params)
end

#set_client_window_state(client_window:, state:, width: Serialization::UNSET, height: Serialization::UNSET, x: Serialization::UNSET, y: Serialization::UNSET) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/selenium/webdriver/bidi/protocol/browser.rb', line 212

def set_client_window_state(
  client_window:,
  state:,
  width: Serialization::UNSET,
  height: Serialization::UNSET,
  x: Serialization::UNSET,
  y: Serialization::UNSET
)
  Serialization.validate!(
    'state',
    state,
    {normal: 'normal', fullscreen: 'fullscreen', maximized: 'maximized', minimized: 'minimized'}
  )
  params = SetClientWindowStateParameters.build(
    client_window: client_window,
    state: state,
    width: width,
    height: height,
    x: x,
    y: y
  )
  execute(cmd: 'browser.setClientWindowState', params: params, result: Browser::ClientWindowInfo)
end

#set_download_behavior(download_behavior:, user_contexts: Serialization::UNSET) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



239
240
241
242
243
244
245
# File 'lib/selenium/webdriver/bidi/protocol/browser.rb', line 239

def set_download_behavior(download_behavior:, user_contexts: Serialization::UNSET)
  params = SetDownloadBehaviorParameters.new(
    download_behavior: download_behavior,
    user_contexts: user_contexts
  )
  execute(cmd: 'browser.setDownloadBehavior', params: params)
end