• 请不要在回答技术问题时复制粘贴 AI 生成的内容
ithelloworld
V2EX  ›  程序员

开发时如何设置各种平台user-agent版本?

  •  
  •   ithelloworld · Jun 4, 2013 · 4661 views
    This topic created in 4740 days ago, the information mentioned may be changed or developed.
    开发手机网站,支持iOS/Android,安装什么样的插件能看到如下版本的效果呢?

    平台: iPod touch(第5代)/iOS 6.1.2
    平台:SO-02C/OS:android 4.03
    平台:LT28h/OS:android 4.04

    在safari,chrome和firefox上试了一下相关插件,版本都不是很高。
    6 replies    1970-01-01 08:00:00 +08:00
    gavingeng
        1
    gavingeng  
       Jun 4, 2013   ❤️ 1
    打开chrome的debug调试,点右下角的齿轮,打开后,你会看到 User-Agent的各种设置.
    dorentus
        2
    dorentus  
       Jun 4, 2013   ❤️ 1
    比较新版的 Chrome,打开『审查元素』的控制台,右下角有个小齿轮,点开之后可以设置 UA、屏幕大小等等信息
    ithelloworld
        3
    ithelloworld  
    OP
       Jun 4, 2013
    @gavingeng
    @dorentus
    谢谢二位回答。
    虽然能找到一些选项,可没有iOS 6的呀。
    ushuz
        4
    ushuz  
       Jun 4, 2013   ❤️ 1
    @ithelloworld 选other,把ios 6的UA填进去。ios 6的UA问谷歌或者自己找台设备试一下。
    ithelloworld
        5
    ithelloworld  
    OP
       Jun 4, 2013
    @ushuz Thanks.

    iPhone :

    Mozilla/5.0 ( iPhone ; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25

    iPad :

    Mozilla/5.0 ( iPad ; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25

    Reference:

    http://stackoverflow.com/questions/12305566/what-is-the-ios-6-user-agent-string
    dorentus
        6
    dorentus  
       Jun 4, 2013
    其实如果你的服务器端并没有针对不同的 UA 输出不同的页面的话,改 UA 测试意义不大(Chrome 那种设置 Device metrics 的方式倒是有些用处)。

    实在没有设备拿来测试的话,你可以在 OS X 上面装 Xcode,然后用它的 iOS 模拟器来看……
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   978 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 20:01 · PVG 04:01 · LAX 13:01 · JFK 16:01
    ♥ Do have faith in what you're doing.