# I'm not able to change the user agent on google chrome with the extensions "UserAgent-Switcher"



## ziomario (Feb 14, 2022)

Hello to everyone.

After several attempts I've been able to install successfully Google Chrome (not Chromium),following this tutorial :

https://forums.freebsd.org/threads/...-google-chrome-linux-binary-on-freebsd.77559/

It runs without problems,it's a shame that it does not allow to install extensions,because a bug that has been fixed for chromium,but not for Google Chrome,as u can see below : (and yes,I'm running the latest version,97. I mean,this bug has been fixed for chromium version 97,but not for google chrome 97).

this is the bug still open : https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258573

To overcome the bug and even because I want to sync and access my google account,I've installed the UserAgent-Switcher in developer mode (I've cloned the github and I've chosen to install the extension unpacked) using this :









						GitHub - ray-lothian/UserAgent-Switcher: A User-Agent spoofer browser extension that is highly configurable
					

A User-Agent spoofer browser extension that is highly configurable - GitHub - ray-lothian/UserAgent-Switcher: A User-Agent spoofer browser extension that is highly configurable




					github.com
				




the tutorial about how to run google chrome at the end,it says :

**Note: Syncing or accessing your google account won't work. It will display:
"Couldn't sign you in This browser or app may not be secure. Try using a different browser. If you’re already using a supported browser, you can refresh your screen and try again to sign in."

To fix this, change your user agent to Firefox, for instance, and login to Gmail (keep it logged in). Then change your user agent back to default and turn on sync. User-Agent Switcher and Manager extension is what worked for me* 

that's excactly what I did,but unfortunately it won't work for me. Two different user agents are detected and the default one is again the chome one and for this reason I can't login to my gmail address and I can't sync.  You can see the video below that I've recorded to understand what happens. Maybe I made some mistake trying to change the user agent and I'm not realizing what's wrong. Please help,thanks.

https://drive.google.com/file/d/18AuPxiIHTabLxTL_HOKfJj0vUv7tgeow/view?usp=sharing


----------



## patovm04 (Feb 15, 2022)

Hi ziomario, you can change your user agent without the need of any extension by appending `--user-agent="Mozilla/5.0 (X11; FreeBSD amd64; Linux x86_64)"` to your Google Chrome wrapper. Something like this:
`/compat/linux/bin/chrome --user-agent="Mozilla/5.0 (X11; FreeBSD amd64; Linux x86_64)"`
After login in you won't need to use that workaround anymore.


----------



## ziomario (Feb 15, 2022)

patovm04 said:


> Hi ziomario, you can change your user agent without the need of any extension by appending `--user-agent="Mozilla/5.0 (X11; FreeBSD amd64; Linux x86_64)"` to your Google Chrome wrapper. Something like this:
> `/compat/linux/bin/chrome --user-agent="Mozilla/5.0 (X11; FreeBSD amd64; Linux x86_64)"`
> After login in you won't need to use that workaround anymore.



that's nice. it worked. do u want to fix your tutorial ? go here :









						[Linuxulator] How to run Google Chrome (linux-binary) on FreeBSD
					

[Update] For new instructions targeting FreeBSD 13.0 and newer, please see: https://forums.freebsd.org/threads/linuxulator-how-to-install-brave-linux-app-on-freebsd-13-0.78879/   Important notes:  1) Tested upon FreeBSD 12.2-RELEASE. Used Ubuntu-based linux compat instead of default CentOS one...




					forums.freebsd.org
				




and change this :


```
[Desktop Entry]
Type=Application
Version=1.0
Encoding=UTF-8
Name=Google Chrome
Comment=Google web browser based on WebKit
Icon=google-chrome
Exec=/compat/linux/bin/chrome
Categories=Application;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;x-sc>
StartupNotify=true
```

with this :


```
[Desktop Entry]
Type=Application
Version=1.0
Encoding=UTF-8
Name=Google Chrome
Comment=Google web browser based on WebKit
Icon=google-chrome
Exec=/compat/linux/bin/chrome --user-agent="Mozilla/5.0 (X11; FreeBSD amd64; Linux x86_64)"
Categories=Application;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;x-sc>
StartupNotify=true
```


----------



## ziomario (Feb 15, 2022)

After several attempts I've been able to install successfully Google Chrome (not Chromium),following this tutorial :

https://forums.freebsd.org/threads/...-google-chrome-linux-binary-on-freebsd.77559/

and I've even synchronized my google informations,such as passwords,websites,bookmarks and so on.  I also did some further experiments. I've installed the nomachine server inside the ubuntu 20.04 os that I've installed inside the jail + linuxulator. I see some errors,but the server process is enabled :


```
@marietto:/# ps ax | grep nx

53433 pts/3 S+ 0:00 /usr/NX/bin/nxclient.bin --monitor --tray
53422 pts/3 S+ 0:12 /usr/NX/bin/nxplayer.bin
53362 pts/2 S+ 0:00 /usr/NX/bin/nxserver.bin
```

unfortunately it will not work because the jail is not provided with an internal IP address.


```
@marietto:/# ip
Cannot open netlink socket: Address family not supported by protocol
```

is there a method to give to the jail a network stack ? I ask this because If I don't get wrong,when I use cbsd and bastille I think I have it. So,the method for running correctly the nomachine server inside the jail with the linuxulator exists.


----------



## ziomario (Feb 16, 2022)

Can u someone explain to me why if I use firefox I can't watch the today's champios league match of the team that I love ? (Inter),but I can do it if I use google chrome that runs within the linux jail ? that's very odd. This is the first time that I see a real advantage using the "emulated" google chrome instead of the native Firefox.


----------



## patovm04 (Feb 16, 2022)

ziomario said:


> that's nice. it worked. do u want to fix your tutorial ? go here :
> 
> 
> 
> ...


Hmmm using `--user-agent="Mozilla/5.0 (X11; FreeBSD amd64; Linux x86_64)"` permanently is not a good idea, because many websites look terribly outdated or kinda broken. That's why I recommend to use it just once to login to a gmail account and don't log out of it. You can then close the browser and run it without this hack in the future. You'll even be able to log in with other accounts without problem as long as it's not from "incognito" mode.


----------



## ziomario (Feb 17, 2022)

patovm04 said:


> Hmmm using `--user-agent="Mozilla/5.0 (X11; FreeBSD amd64; Linux x86_64)"` permanently is not a good idea, because many websites look terribly outdated or kinda broken. That's why I recommend to use it just once to login to a gmail account and don't log out of it. You can then close the browser and run it without this hack in the future. You'll even be able to log in with other accounts without problem as long as it's not from "incognito" mode.



but if the idea to use an user agent switcher does not work,it does not make sense to suggest it.


----------



## ziomario (Feb 17, 2022)

ziomario said:


> Can u someone explain to me why if I use firefox I can't watch the today's champios league match of the team that I love ? (Inter),but I can do it if I use google chrome that runs within the linux jail ? that's very odd. This is the first time that I see a real advantage using the "emulated" google chrome instead of the native Firefox.
> 
> View attachment 13040



do u you have any consideration to make here ?


----------



## eternal_noob (Feb 17, 2022)

Maybe disable your ad blocker?

(Suggestion taken from here)


----------



## ziomario (Feb 17, 2022)

The error is changed. Now *it looks for the Widevine Content Decryption,but it seems that it works only on Linux 64 bit.*


----------



## ziomario (Feb 17, 2022)

Hello.

I'm trying to run the edge browser following the tutorial : https://forums.freebsd.org/threads/...-google-chrome-linux-binary-on-freebsd.77559/

so,I've folllowed that tutorial,with some minor changes. For example,I've created the custom edge launcher script called /compat/linux/bin/edge and I made it executable:


```
#!/compat/linux/bin/bash
export EDGE_PATH="/usr/bin/microsoft-edge-dev"
export EDGE_WRAPPER="`readlink -f "$0"`"
export LD_LIBRARY_PATH=/usr/local/steam-utils/lib64/fakeudev
export LD_PRELOAD=/usr/local/steam-utils/lib64/webfix/webfix.so
export LIBGL_DRI3_DISABLE=1
exec -a "$0" "$EDGE_PATH" --no-sandbox --no-zygote --test-type --v=0 "$@"
```

and I've created this desktop file to launch edge as any other app:


```
[Desktop Entry]
Type=Application
Version=1.0
Encoding=UTF-8
Name=Edge
Comment=Edge web browser
Icon=edge
Exec=/compat/linux/bin/edge
Categories=Application;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;
StartupNotify=true
```

unfortunately when I execute it,I get the following error message :


```
@marietto:/home/marietto/Desktop/Browsers # /compat/linux/bin/edge
/compat/linux/bin/edge: line 9: /usr/bin/microsoft-edge-dev: No such file or directory
```

I don't know why,since the microsoft-edge-dev file is located on /compat/linux/usr/bin :


```
@marietto:/home/marietto/Desktop/Browsers # find /compat/linux/usr/bin -name microsoft-edge-dev
/compat/linux/usr/bin/microsoft-edge-dev
```

and the wrapper called edge is located on /compat/linux/bin


```
marietto:/home/marietto/Desktop/Browsers # find /compat/linux/bin -name edge
/compat/linux/bin/edge
```


----------



## eternal_noob (Feb 17, 2022)

This is your 4th topic in a single thread.

1. User agent switcher in Chrome
2. jail is not provided with an internal IP address
3. Firefox & Primevideo
4. Errors running Edge

It's totally confusing and i suggest to open a new dedicated thread for each question you have in the future.


----------



## ziomario (Feb 17, 2022)

eternal_noob said:


> This is your 4th topic in a single thread.
> 
> 1. User agent switcher in Chrome
> 2. jail is not provided with an internal IP address
> ...



I can see a red thread that connects all of those topics and I don't want to open a lot of dispersive topics if they are all connected to one only thread. But maybe you don't understand this because we have a different kind of mental order.


----------



## eternal_noob (Feb 17, 2022)

Ok, maybe i am stupid but what's the connection between a user agent switcher in Chrome and errors running Edge for example?


----------



## ziomario (Feb 18, 2022)

eternal_noob said:


> Ok, maybe i am stupid but what's the connection between a user agent switcher in Chrome and errors running Edge for example?



the connection between all those topics is that I'm trying to run more browsers in FreeBSD using the linux jails,to expand what Freebsd can do and all the tutorials that I'm following have been written by patovm04,so I've thought that it was a good idea to keep talking where the patovm04 tutorials ended some time ago.


----------

