代号一-BrowserComponent:自定义用户代理 [英] Codename One - BrowserComponent: custom user-agent

查看:69
本文介绍了代号一-BrowserComponent:自定义用户代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了BrowserComponent API,但是没有找到任何setUserAgent()方法。如何强制BrowserComponent使用自定义的用户代理字符串?

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?

非常感谢您的帮助。

推荐答案

该文件并未得到真正的记录,因为并非所有地方都支持它,但在Android和iOS上应该可以正常工作。这应该起作用:

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);

这篇关于代号一-BrowserComponent:自定义用户代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆