Skip to content
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

"useragent" passed is not honored when using "webkit" browser. #3383

Open
srajendran123 opened this issue Jan 19, 2024 · 10 comments
Open

"useragent" passed is not honored when using "webkit" browser. #3383

srajendran123 opened this issue Jan 19, 2024 · 10 comments
Labels
closeable? This issue should be closed?

Comments

@srajendran123
Copy link

srajendran123 commented Jan 19, 2024

Describe the bug
user-agent passed file is not honored when using WebKit. Rather, the system config where the test runs is passed as the user agent.

To Reproduce
Steps to reproduce the behavior:

  1. Through automation load any url using "New Persistent Context" or with a combination of New Browser/New Context/New Page) keyword with the following parameters:
    browser - "webkit"
    user agent - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15
    viewport - "{'width': 810, 'height': 1010}"

Actual behavior
Observe that user-agent passed is not honored when using WebKit. Rather, the system config where the test runs is passed as the user agent.

Screenshots
chromium.webm.zip
webkit.webm.zip

Desktop (please complete the following information):
OS: Windows
Browser: Webkit through automation
Version: Playwright version 1.0 [1]

Additional context
When loading a webpage using chromium or firefox without user agent, none is passed to user agent as expected. However, same issue as described exists when using webkit, system config where the test runs is passed as the user agent.

@srajendran123
Copy link
Author

@aaltat - Just wondering, if there any update on this ticket? Thanks.

@aaltat
Copy link
Member

aaltat commented Jan 26, 2024

Not yet, https://robocon.io/ is near and it’s eating all available time

@aaltat
Copy link
Member

aaltat commented Feb 16, 2024

I do not quite follow what you did expect to happen, but you can change user agent as you want in New Context keyword userAgent argument. I did check code and we should not set user agent inside of our code. So either it is done by Playwright or by the browser binaries itself. But in any case user agent is easy to change as you want.

@aaltat aaltat added the closeable? This issue should be closed? label Feb 16, 2024
@srajendran123
Copy link
Author

@aaltat When "webkit" is used, user agent provided in the script is not used when loading the application. Please refer to the attached webkit zip file above.

image

In the screenshot, mac useragent is provided in the script "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" . However, application is loaded with windows user agent, as the test is run on windows machine.

This is not an issue when using "chromium" browser. App is loaded with whatever useragent passed in the automation script. Please refer to the attached windows zip file above.

Please let me know, if additional info is needed.

@srajendran123
Copy link
Author

Here is the code, we are using to invoke the app

New Persistent Context url=${url} browser=${execution_browser} headless=${headless} userAgent=${userAgent} viewport=${viewport}

url - "https://pwa-br-us-a.qa.tillster.com/"
browser - "webkit"
user agent - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15
viewport - "{'width': 810, 'height': 1010}"

@aaltat
Copy link
Member

aaltat commented Feb 17, 2024

Browser library doesn’t not alter the parameter, we pass it as is in the Playwright side. This is a bug in the upstream side, meaning Playwright or Apple. Also we can’t fix this in the Browser library side.

You need to raise the issue with Playwright and in the worst case to Apple. But because we can’t fix this, I am going to close this issue.

@srajendran123
Copy link
Author

Hi Rene,

Can we please get an update on this ticket?

Thanks,

Sharmila

@aaltat
Copy link
Member

aaltat commented Mar 19, 2024

No updates, no-one has not looked at the problem. If have a need, easiest way is to debug the issue by you and provide the fix.

@srajendran123
Copy link
Author

Hello @aaltat @Snooz82 - We don't have the expertise to contribute to the fix for this issue. Would be great, if this could be looked into by the RF team. Thanks.

@aaltat
Copy link
Member

aaltat commented Apr 26, 2024

We understand, but we can’t give you a timeline or estimate when this could be fixed. Most likely answer is later than sooner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closeable? This issue should be closed?
Projects
None yet
Development

No branches or pull requests

3 participants