Skip to content

Please add support for UserAgent in web drivers #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MVKozlov opened this issue May 28, 2020 · 3 comments
Closed

Please add support for UserAgent in web drivers #91

MVKozlov opened this issue May 28, 2020 · 3 comments
Assignees
Milestone

Comments

@MVKozlov
Copy link

Please add support for UserAgent in web drivers

at least for Chrome it just

$Options.AddArguments("user-agent=$UserAgent")

btw, may be there is a reason for New-SeChromeDriverOptions and
Start-SeChrome -Options $Options way ?

@itfranck itfranck self-assigned this Aug 4, 2020
@itfranck itfranck added this to the V4.0 milestone Aug 4, 2020
@itfranck
Copy link
Collaborator

itfranck commented Aug 4, 2020

@MVKozlov

The arguments parameter can allow you to pass additional options.
(It does the $Options.AddArguments behind the scene )

For instance

$Driver = Start-SeChrome -StartURL 'https://www.google.ca' -AsDefaultDriver -Arguments ("user-agent=Android")

I'll keep this ticket open though as I'd see this implemented as a parameter with an argument completer so it is more transparent.

@itfranck
Copy link
Collaborator

Because there's no unilateral support for all the browsers (eg: IE do not support user agent changes, Firefox require setting up a profile, etc..), I can't add an explicit useragent parameter that would accomodate all browser but as mentionned previously, I added argument completion for V4 to suggest some of the most useful parameters so it make it setting it for Chrome a little bit easier.

image

@itfranck itfranck reopened this Oct 3, 2020
itfranck added a commit that referenced this issue Oct 3, 2020
Chrome / Firefox only. Throw an error if attempted with any other browser.
itfranck added a commit that referenced this issue Oct 3, 2020
@itfranck
Copy link
Collaborator

itfranck commented Oct 3, 2020

@MVKozlov Done. It will be available for V4 as a parameter.
Note that only Firefox and Chrome support this.

@itfranck itfranck closed this as completed Oct 3, 2020
itfranck added a commit that referenced this issue Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants