2

I have tried pretty much every way mentioned on SO and the docs and failed.
Specifically, I'm using WebdriverJS through Node.js.
I'd want a way to programatically make Firefox-Quantum use a proxy, which requires auth and port (i.e http://user:pass@host:port).

I don't mind to use an extension for this, but I don't know which one I could use for programmatic access.

I do not want a solution involving the authentication dialog popping up and asking for the auth.

I used to manage to do it on Firefox 56.0 using an extension called CloseProxy. (As per How to set proxy authentication (user & password) using python selenium)

However, CloseProxy is not supported on Firefox-Quantum.

This is my last attempt at this issue before resorting to going ahead and writing my own Webextension for this so I hope someone somewhere has the answer

1 Answers1

1

Somethig like that should work:

var webdriver = require('selenium-webdriver'),
         proxy = require('selenium-webdriver/proxy');

var driver = new webdriver.Builder()
     .withCapabilities(webdriver.Capabilities.firefox())
     .setProxy(proxy.manual({http: 'host:1234'}))
     .build();

Actually there is a lot of info about this https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/proxy.html

B.Misha
  • 107
  • 9