Class: Selenium::WebDriver::Network
Relationships & Source Files | |
Inherits: | Object |
Defined in: | rb/lib/selenium/webdriver/common/network.rb |
Class Method Summary
- .new(bridge) ⇒ Network constructor
Instance Attribute Summary
- #auth_callbacks readonly
Instance Method Summary
Constructor Details
.new(bridge) ⇒ Network
Instance Attribute Details
#auth_callbacks (readonly)
[ GitHub ]# File 'rb/lib/selenium/webdriver/common/network.rb', line 23
attr_reader :auth_callbacks
Instance Method Details
#add_authentication_handler(username, password)
[ GitHub ]# File 'rb/lib/selenium/webdriver/common/network.rb', line 30
def add_authentication_handler(username, password) intercept = @network.add_intercept(phases: [BiDi::Network::PHASES[:auth_required]]) auth_id = @network.on(:auth_required) do |event| request_id = event['requestId'] @network.continue_with_auth(request_id, username, password) end @auth_callbacks[auth_id] = intercept auth_id end
#clear_authentication_handlers
[ GitHub ]# File 'rb/lib/selenium/webdriver/common/network.rb', line 47
def clear_authentication_handlers @auth_callbacks.each_key { |id| remove_authentication_handler(id) } end
#remove_authentication_handler(id)
[ GitHub ]# File 'rb/lib/selenium/webdriver/common/network.rb', line 41
def remove_authentication_handler(id) intercept = @auth_callbacks[id] @network.remove_intercept(intercept['intercept']) @auth_callbacks.delete(id) end