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

该网页是如何判断用户是否使用移动设备的?仅在开发者工具中使用 iPhone 用户代理,打开网页的结果不符合预期,必须在 devtools 中模拟移动设备才符合预期

  •  
  •   VisualStudioCode · Nov 1, 2023 · 1343 views
    This topic created in 959 days ago, the information mentioned may be changed or developed.

    https://www.1point3acres.com/bbs/tag-9620-1.html

    在开发者工具中,启用模拟移动设备,进入该网页会跳转至该网页的移动版。

    然而,仅在 devtools 的「网络状况」中使用 iPhone 用户代理的话,进入该网页会跳转至另一个不符合预期的网页:

    https://www.1point3acres.com/bbs/forum.php?mobile=1

    备注:我使用的 iPhone 用户代理:

    Mozilla/5.0 (iPhone; CPU iPhone OS 17_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Mobile/15E148 Safari/604.1

    1 replies    2023-11-01 17:31:16 +08:00
    Rache1
        1
    Rache1  
       Nov 1, 2023   ❤️ 1
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   924 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 20:47 · PVG 04:47 · LAX 13:47 · JFK 16:47
    ♥ Do have faith in what you're doing.