Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

How do you change useragent with WebDriverJs ? #6189

Closed
lukeis opened this issue Mar 4, 2016 · 11 comments
Closed

How do you change useragent with WebDriverJs ? #6189

lukeis opened this issue Mar 4, 2016 · 11 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 6189

Not documented anywhere :(

Reported by delvarworld on 2013-08-29 02:30:54

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Please send questions to the selenium user list [1]

[1] https://groups.google.com/forum/#!forum/selenium-users

Reported by barancev on 2013-08-29 12:54:10

  • Status changed: Invalid
  • Labels removed: Status-Untriaged

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I did. I've asked lots of people. No one knows. The bug is the lacking documentation
on the nodejs driver.

Reported by delvarworld on 2013-08-31 21:10:15

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

OK, the answer is: you can't
Use a proxy, e.g. https://github.com/webmetrics/browsermob-proxy

Reported by barancev on 2013-09-02 07:32:31

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

This is unfortunate. Maybe the documentation should be updated with a warning that the
official selnium node driver is incomplete?

Reported by delvarworld on 2013-09-05 05:50:50

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Hey, is there a way to contribute to enable this? There definitely should be a way to
pass browser switches when starting the driver.

Reported by mrejzlin on 2013-11-19 16:12:16

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Hi all,

Is  there any way to change the user-agent using webdriverJs javascript on chrome browser
..

please give me information if any one know 

Thank you 
RAj

Reported by beemiraja on 2014-02-12 15:23:17

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

You can do it with Chrome, even though it's completely undocumented:

https://code.google.com/p/selenium/issues/detail?id=6189#makechanges

It's odd that the maintainers of this project don't know about it?

Reported by delvarworld on 2014-04-14 20:33:17

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

You do realize that your link doesn't go anywhere, right?

Reported by jamesawharton on 2014-07-13 21:52:03

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

My bad, it was supposed to link to http://stackoverflow.com/questions/18501387/how-to-change-selenium-user-agent-in-selenium-webdriver-nodejs-land/23069825#23069825

Reported by delvarworld on 2014-07-14 20:54:12

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Selenium does not provide API to change headers.

On the other hand, Selenium allows to pass arbitrary arguments to an executable driver
(for the browsers that has one -- IE, Chrome) or to an executable browser (PhantomJS).
So if a driver or a browser has an argument to change user-agent -- you're in luck.
But it is a workaround, not a Selenium feature.

Also you can use a proxy (e.g. browsermobproxy) as a man-in-the-middle to change headers.

Reported by barancev on 2014-07-14 21:19:13

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 18:17:53

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 4, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant