This is the site where I learned the procedure to output the userAgent using bash on Ubuntu 22.04:
Get the "user agent" string from a new Google Chrome browser session from bash
and I had the command:
echo navigator.userAgent | /opt/google/chrome/chrome --headless --repl | perl -pe 's/^>>> //; s/HeadlessChrome/Chrome/g' | jq -r .result.value
Which worked perfectly until the version before Chrome 113, after which it gave only errors:
[0531/154816.789187:WARNING:bluez_dbus_manager.cc(247)] Floss manager not present, cannot set Floss enable/disable.
[0531/154816.807959:WARNING:sandbox_linux.cc(393)] InitializeSandbox() called with multiple threads in process gpu-process.
[0531/154816.812699:ERROR:command_buffer_proxy_impl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
Solved thanks to the link:
How to Supress "Floss manager not present, cannot set Floss enable/disable."
But with this code, even if no more errors appear:
echo navigator.userAgent | /opt/google/chrome/chrome --headless=new --repl --remote-allow-origins=* | perl -pe 's/^>>> //; s/HeadlessChrome/Chrome/g' | jq -r .result.value
The command shell expects input but I've already given it through the pipe, which apparently didn't work.
How do I solve the problem?