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: 'clientWindow',
  height: 'height',
  state: {wire_key: 'state', enum: 'Browser::CLIENT_WINDOW_INFO_STATE'},
  width: 'width',
  x: 'x',
  y: 'y'
)
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: 'userContext')
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: 'userContext')
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.



145
146
147
# File 'lib/selenium/webdriver/bidi/protocol/browser.rb', line 145

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.



151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/selenium/webdriver/bidi/protocol/browser.rb', line 151

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

#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.



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

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.



172
173
174
# File 'lib/selenium/webdriver/bidi/protocol/browser.rb', line 172

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.



178
179
180
181
# File 'lib/selenium/webdriver/bidi/protocol/browser.rb', line 178

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.



185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/selenium/webdriver/bidi/protocol/browser.rb', line 185

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.



211
212
213
214
215
216
217
# File 'lib/selenium/webdriver/bidi/protocol/browser.rb', line 211

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