I want to get the User Agent HTTP request header string from a new Google Chrome browser session (just opened) from bash and put it in a variable.
Here is the pseudo-code:
USER_AGENT="$(google-chrome --user-agent)"
echo "$USER_AGENT"
Output example:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
If it is not possible to do this with the google-chrome
command, what is an equivalent workaround?