-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Description
I am trying to block all API requests to google from my selenium browser session using browsermob. Below is my code:
Capybara.register_driver :selenium_without_google do |app|
filename = File.join(Rails.root, "lib", "browsermob", "bin", "browsermob-proxy")
server = BrowserMob::Proxy::Server.new(filename) #=> #<BrowserMob::Proxy::Server:0x000001022c6ea8 ...>
server.start
proxy = server.create_proxy #=> #<BrowserMob::Proxy::Client:0x0000010224bdc0 ...>
proxy.blacklist(/google/, '200')
profile = Selenium::WebDriver::Firefox::Profile.new #=> #<Selenium::WebDriver::Firefox::Profile:0x000001022bf748 ...>
profile.proxy = proxy.selenium_proxy
Capybara::Selenium::Driver.new(app, :browser => :firefox, :profile => profile)
end
It is still sending out the API calls. Any direction you can give me on this?
Metadata
Metadata
Assignees
Labels
No labels