Class: Selenium::WebDriver::BiDi::Network
Relationships & Source Files | |
Inherits: | Object |
Defined in: | rb/lib/selenium/webdriver/bidi/network.rb |
Constant Summary
-
EVENTS =
# File 'rb/lib/selenium/webdriver/bidi/network.rb', line 24{ before_request: 'network.beforeRequestSent', response_started: 'network.responseStarted', response_completed: 'network.responseCompleted', auth_required: 'network.authRequired', fetch_error: 'network.fetchError' }.freeze
-
PHASES =
# File 'rb/lib/selenium/webdriver/bidi/network.rb', line 32{ before_request: 'beforeRequestSent', response_started: 'responseStarted', auth_required: 'authRequired' }.freeze
Class Method Summary
- .new(bidi) ⇒ Network constructor
Instance Method Summary
Constructor Details
.new(bidi) ⇒ Network
# File 'rb/lib/selenium/webdriver/bidi/network.rb', line 38
def initialize(bidi) @bidi = bidi end
Instance Method Details
#add_intercept(phases: [], contexts: nil, url_patterns: nil)
[ GitHub ]# File 'rb/lib/selenium/webdriver/bidi/network.rb', line 42
def add_intercept(phases: [], contexts: nil, url_patterns: nil) @bidi.send_cmd('network.addIntercept', phases: phases, contexts: contexts, urlPatterns: url_patterns) end
#continue_with_auth(request_id, username, password)
[ GitHub ]# File 'rb/lib/selenium/webdriver/bidi/network.rb', line 50
def continue_with_auth(request_id, username, password) @bidi.send_cmd( 'network.continueWithAuth', 'request' => request_id, 'action' => 'provideCredentials', 'credentials' => { 'type' => 'password', 'username' => username, 'password' => password } ) end
#continue_with_request(**args)
[ GitHub ]# File 'rb/lib/selenium/webdriver/bidi/network.rb', line 63
def continue_with_request(**args) @bidi.send_cmd( 'network.continueWithRequest', request: args[:request_id], 'body' => args[:body], 'cookies' => args[: ], 'headers' => args[:headers], 'method' => args[:method], 'url' => args[:url] ) end
#on(event)
[ GitHub ]# File 'rb/lib/selenium/webdriver/bidi/network.rb', line 75
def on(event, &) event = EVENTS[event] if event.is_a?(Symbol) @bidi.add_callback(event, &) end
#remove_intercept(intercept)
[ GitHub ]# File 'rb/lib/selenium/webdriver/bidi/network.rb', line 46
def remove_intercept(intercept) @bidi.send_cmd('network.removeIntercept', intercept: intercept) end