class Selenium::WebDriver::Network

def add_authentication_handler(username, password)

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
  @callbacks[auth_id] = intercept
  auth_id
end