I meant web content can't change the actual browser user agent.
You can override the local JavaScript string in navigator.userAgent but it just overwrites it for the current page, it doesn't actually change the browser user agent.
Bots that customise the user agent string do it by altering the browser itself. I don't think normal web pages have that control. So I think it's impossible from JS code.