I have this code:
let profile = new firefox.Profile();
profile.setPreference('modifyheaders.headers.auth_user', 'cdt_admin.gen');
profile.setPreference('modifyheaders.headers.cdt_app_token', cdtAppToken);
let opts = new firefox.Options().setProfile(profile);
let driver = new webdriver.Builder()
.forBrowser('firefox')
.setFirefoxOptions(opts)
.build();
but it's not adding any headers to the request
I believe I need to use a few more lines of code..something like this:
// this is Python I think
fp = webdriver.FirefoxProfile()
path_modify_header = '/Users/foobar/modify_headers-0.7.1.1-fx.xpi'
fp.add_extension(path_modify_header)
How can I do this with Node.js? From what I can tell, it's only possible to modify headers with Firefox..is it really not possible with Google Chrome?
Here are the Selenium JS docs:
As the Python example suggests, it's just a string that needs to be passed to profile.addExtension().
via Alexander Mills
No comments:
Post a Comment