LoginSignup
0
0

【userAgent】【UAParser.js】iPhoneかどうかの判定が正常に動かなかった

Posted at

背景

端末で動作を変えたい状況で、iPhoneかどうかの判定をuserAgentUAParser.jsを使用して実装したが、どちらでも想定した動作にならなかった。

現象

iPhoneからアクセスしているのに、MacOSとして判定される

SL4gR7n0_1.png

原因

iPhoneの設定が「デスクトップ用Webサイトを表示」になっていた。
「モバイル用Webサイトを表示」に切り替えることで想定する表示になった。

r3-g0wGw_1.png

A042AcYR_1.png

おわりに

原因はわかったが、対策は不明……。
どうすればいいんだろう……。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0