mrboog13
Posts: 5
Joined: Thu Oct 11, 2018 5:04 am

Changing the UserAgent of chromium on startup?

Sun Jan 27, 2019 7:13 pm

Im not quite sure how to set this up as I am new to outside .JS

I am trying to change it from its current Useragent to:

Code: Select all

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36
Its something I want to add to startup. so when the pi boots into GUI, it will open chromium with that useragent instead of its current

I need this changed cause the sites I wish to visit/play on wont accept the current Useragent and I dont want to have to keep opening developer tools/network to change it each time I boot.

Is this possible in a startup script or am I just wasting time?

Andyroo
Posts: 3351
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Changing the UserAgent of chromium on startup?

Sun Jan 27, 2019 7:20 pm

By default Chrome / Chromium only allows the user agent to be set for a single page.

You could compile the source after changing the string or use an add-in such as https://chrome.google.com/webstore/deta ... pkjnoahfmg
Need Pi spray - these things are breeding in my house...

mrboog13
Posts: 5
Joined: Thu Oct 11, 2018 5:04 am

Re: Changing the UserAgent of chromium on startup?

Sun Jan 27, 2019 7:25 pm

Ah... ok

edit: I discovered that it is possible to change by just opening via terminal with:

Code: Select all

chromium-browser --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36"
after checking with whatsmyuseragent[dot]org, it returned working and was able to play my games now :)

Return to “Raspbian”