Class: Selenium::WebDriver::BiDi::InterceptedRequest

Inherits:
InterceptedItem show all
Defined in:
lib/selenium/webdriver/bidi/network/intercepted_request.rb

Instance Attribute Summary collapse

Attributes inherited from InterceptedItem

#network, #request

Instance Method Summary collapse

Methods inherited from InterceptedItem

#id

Constructor Details

#initialize(network, request) ⇒ InterceptedRequest

Returns a new instance of InterceptedRequest.



30
31
32
33
34
35
36
37
# File 'lib/selenium/webdriver/bidi/network/intercepted_request.rb', line 30

def initialize(network, request)
  super
  @method = nil
  @url = nil
  @body = nil
  @headers = nil
  @cookies = nil
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



28
29
30
# File 'lib/selenium/webdriver/bidi/network/intercepted_request.rb', line 28

def body
  @body
end

#methodObject

Returns the value of attribute method.



27
28
29
# File 'lib/selenium/webdriver/bidi/network/intercepted_request.rb', line 27

def method
  @method
end

#urlObject

Returns the value of attribute url.



27
28
29
# File 'lib/selenium/webdriver/bidi/network/intercepted_request.rb', line 27

def url
  @url
end

Instance Method Details

#continueObject



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/selenium/webdriver/bidi/network/intercepted_request.rb', line 39

def continue
  cookies = @cookies&.as_json
  headers = @headers&.as_json
  network.continue_request(
    id: id,
    body: body,
    cookies: cookies,
    headers: headers,
    method: method,
    url: url
  )
end

#cookies(cookies = {}) ⇒ Object



71
72
73
# File 'lib/selenium/webdriver/bidi/network/intercepted_request.rb', line 71

def cookies(cookies = {})
  @cookies ||= Cookies.new(cookies)
end

#cookies=(cookies = {}) ⇒ Object



75
76
77
# File 'lib/selenium/webdriver/bidi/network/intercepted_request.rb', line 75

def cookies=(cookies = {})
  @cookies = Cookies.new(cookies)
end

#failObject



52
53
54
# File 'lib/selenium/webdriver/bidi/network/intercepted_request.rb', line 52

def fail
  network.fail_request(id)
end

#headers(headers = {}) ⇒ Object



67
68
69
# File 'lib/selenium/webdriver/bidi/network/intercepted_request.rb', line 67

def headers(headers = {})
  @headers ||= Headers.new(headers)
end

#headers=(headers = {}) ⇒ Object



63
64
65
# File 'lib/selenium/webdriver/bidi/network/intercepted_request.rb', line 63

def headers=(headers = {})
  @headers = Headers.new(headers)
end