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

Fix user agent hint platform for macOS #810

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SBerkovic
Copy link

This pull request fixes an issue with the _getPlatform function in the user-agent-override evasion where the user agent hint platform for macOS devices was incorrectly returned as 'Mac OS X' instead of 'macOS'.
In the real world, the sec-ch-ua-platform header for macOS devices is set to 'macOS', as documented in the official MDN Web Docs (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Platform).

The function has been updated to correctly return 'macOS' when the extended parameter is set to true. I have also updated the corresponding test case to reflect the change in the sec-ch-ua-platform header for macOS devices.

Updated the `_getPlatform` function to correctly return the user agent hint for macOS devices in stealth mode. The function now returns 'macOS' instead of 'Mac OS X' when the `extended` parameter is set to `true`.
Also updated the test case to reflect the change in the `sec-ch-ua-platform` header for macOS devices.
@github-actions github-actions bot added plugin: puppeteer-extra PuppeteerExtra Plugin related plugin: stealth ㊙️ Detection evasion related labels May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: puppeteer-extra PuppeteerExtra Plugin related plugin: stealth ㊙️ Detection evasion related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant