How to set CLI flags for Google Chrome?
Look in /opt/google/chrome/google-chrome.desktop
or /usr/share/applications/google-chrome.desktop
for the following line:
Exec=/opt/google/chrome/google-chrome %U
Add the flag you need in there, save it, then run Chrome again and pin it to your launcher, that should do the trick.
A way is to set flags in the environment variable CHROMIUM_USER_FLAGS
:
export CHROMIUM_USER_FLAGS="insert_content_here"
For xubuntu/xfce4, though it might work similarly elsewhere:
cp /usr/share/applications/google-chrome.desktop ~/.local/share/applications/google-chrome.desktop
and modify the three Exec=
lines in ~/.local/share/applications/google-chrome.desktop
to include the arguments you want. Because it has the same filename, xfce4-whiskermenu will pick up only your modified google-chrome.desktop
.
If Chrome is your default browser, another application opening a URL will still cause Chrome to launch without your arguments. To fix this, create a new file ~/bin/google-chrome
with these contents:
/usr/bin/google-chrome YOUR_EXTRA_ARGS "$@"
and chmod +x ~/bin/google-chrome
. Then, in Preferred Applications, set your Web Browser to Other... and enter:
/home/YOUR_USERNAME/bin/google-chrome "%s"
Also, to avoid having to change the arguments in four places in the future, you can point the Exec=
lines in google-chrome.desktop
to your /home/YOUR_USERNAME/bin/google-chrome
.
I'm running Xubuntu and I was trying to figure this one out as well. I tried the solution to edit the .desktop file. I haven't updated, but I have the same concern as you (will it get overwritten). I tried a different option where I added an alias to my .bashrc file.
alias chromium-browser="/usr/bin/chromium-browser [FLAGS]"