You are not logged in.
I would like to override Google Chrome's User-Agent request header. Invoking the executable directly yields the desired results:
/opt/google/chrome/google-chrome --user-agent="Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"When I put the command line parameter in ~/.config/chrome-flags.conf, running the wrapper script (/usr/bin/google-chrome-stable, see below) opens a number of tabs ("%28windows", "nt", "wow64%29", etc.) instead. I suppose this has something to do with Bash parameter expansion, but I'm really not an expert. Any ideas on how to fix this?
#!/bin/bash
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config}
# Allow users to override command-line options
if [[ -f $XDG_CONFIG_HOME/chrome-flags.conf ]]; then
CHROME_USER_FLAGS="$(grep -v '^#' $XDG_CONFIG_HOME/chrome-flags.conf)"
fi
# Launch
exec /opt/google/chrome/google-chrome $CHROME_USER_FLAGS "$@"Last edited by BitFlipp (2023-11-22 20:18:50)
Offline