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
#on(event)
[ GitHub ]# File 'rb/lib/selenium/webdriver/bidi/network.rb', line 63
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