MeiK2333 / pyppeteer_stealth

MIT License
245 stars 53 forks source link

Can't change platform #15

Open bland328 opened 3 years ago

bland328 commented 3 years ago

Thanks very much for this module! I'm using pyppeteer (pup2.1.1 branch) and pyppeteer_stealth, and testing detected browser attributes with https://amiunique.org/fp.

Everything seems to be working well, except that setting platform = "MacIntel" has no effect, meaning my browser is still detected as platform Linux x86_64.

Any thoughts on why just this one attribute might not be working out, or advice on how to troubleshoot?

mcolella14 commented 3 years ago

@bland328 Just took a quick look at how they're grabbing that value, and it looks like they're parsing the OS from the user agent, rather than taking it from navigator.platform, which is the value affected by the platform arg. Just find a Mac user agent string and use the user_agent arg as well, and it should work.

mcolella14 commented 3 years ago

Actually nevermind, just saw that they do actually check navigator.platform for the platform section, for some reason i thought you meant the OS at the top of the page, that's my bad. I'm also using the pup2.1.1 branch, but can't recreate the issue. Could you share the code you're running?