Class: Selenium::WebDriver::BiDi::Protocol::Permissions Private

Inherits:
Domain
  • Object
show all
Defined in:
lib/selenium/webdriver/bidi/protocol/permissions.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.

Constant Summary collapse

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

{
  granted: 'granted',
  denied: 'denied',
  prompt: 'prompt'
}.freeze
PermissionDescriptor =

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(name: {wire_key: 'name', primitive: 'string'})
SetPermissionParameters =

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(
  descriptor: {wire_key: 'descriptor', ref: 'Permissions::PermissionDescriptor'},
  state: {wire_key: 'state', enum: 'Permissions::PERMISSION_STATE'},
  origin: {wire_key: 'origin', primitive: 'string'},
  embedded_origin: {wire_key: 'embeddedOrigin', required: false, primitive: 'string'},
  user_context: {wire_key: 'userContext', required: false, primitive: 'string'}
)

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

#set_permission(descriptor:, state:, origin:, embedded_origin: Serialization::UNSET, user_context: 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.



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/selenium/webdriver/bidi/protocol/permissions.rb', line 52

def set_permission(
  descriptor:,
  state:,
  origin:,
  embedded_origin: Serialization::UNSET,
  user_context: Serialization::UNSET
)
  Serialization.validate!('state', state, Permissions::PERMISSION_STATE)
  params = SetPermissionParameters.new(
    descriptor: descriptor,
    state: state,
    origin: origin,
    embedded_origin: embedded_origin,
    user_context: user_context
  )
  execute(cmd: 'permissions.setPermission', params: params)
end