Cannot set user agent
See original GitHub issueHow do I override the user agent? I have tried the following;
const stealthPlugin = require('puppeteer-extra-plugin-stealth')();
stealthPlugin.enabledEvasions['user-agent-override'] = 'Cool Agent';
puppeteer.use(stealthPlugin);
However when I navigate to https://bot.sannysoft.com/
I can see the user agent is unchanged.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to Change User-Agents in Chrome, Edge, Safari & Firefox
In Firefox, it is possible to change user-agents via the browser's built-in settings. However, it is not as user-friendly as on Chrome or ......
Read more >Cannot include user-agent into my headers - Stack Overflow
Use the HttpRequestHeader.UserAgent instead of a string "User-Agent ". That'll fix it.
Read more >User-Agent - HTTP - MDN Web Docs - Mozilla
The User-Agent request header is a characteristic string that lets servers and network peers identify the application, operating system, ...
Read more >How to Change User-Agent in Chrome, Firefox, Safari, and more
Change user -agent from Inspect element window. ... For demonstration, I am going to use Chrome. You can follow the exact same instructions...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
PS: I’m working on a better/unified way to override stealth plugin settings in #303
@berstend Thanks for this. Sorry for the late reply. I’m curious what exactly is
locale
? Do these languages have to match the browser languages set by puppeteer? For example if I go tohttps://bot.sannysoft.com
it will say my languages areen-US,en
. Are these the values I should use? What isq=0.9
?This is a user agent I found
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36
, how would I construct the object for this?I’m not sure if my example above is correct or not.