问题
I've read the BrowserComponent API, but I didn't find any setUserAgent() method. How can I force the BrowserComponent to use a custom user-agent string?
Thank you very much for any help.
回答1:
It's not really documented since it isn't supported everywhere but should work fine on Android and iOS. This should work:
browserComponent.setProperty("useragent", yourUserAgentHere);
来源:https://stackoverflow.com/questions/45786836/codename-one-browsercomponent-custom-user-agent