先日の、IEのUserAgent値についてのエントリの続き。
アプリケーション側で、ブラウザのUserAgent値をもとにOSやブラウザのバージョンを判定しそれぞれに基づいて処理を変更している場合に、そのOSやブラウザを用意できない場合に仮想的にそのOS・ブラウザを装う方法。
(Windows限定。MacOSXでの手順は不明)
①[スタート]-[ファイル名を指定して実行]で”regedit"を入力して実行
②HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0を展開する。
③編集→新規キーで追加。および、既存は右クリック→修正で以下のように設定する。
名前 型 データ
(標準) または (既定) 文字列 Mozilla/4.0
Version 文字列 MSIE 8.0
Platform 文字列 Windows NT 6.1
この設定で、User-Agent値上はWindows7でInternetExplorer8を装うことが可能。
同じ理屈ででiOSとSafariの値をセットして、iPhoneからのアクセスを仮想的に実行してiPhoneからのアクセス時の切り替えUIを確認出来たりする。(はず)
(追記)
参考にさせていただいたサイトのリンクを残しておらず、参考として載せておりません。分かり次第追記したいと思います。
2012-02-23
2012-02-20
[ブラウザ]WindowsとIEのUser-Agent値
世の中、Windows7導入とかIE6廃止とかの対応でIE6から来たら処理変えるとか弾くなどの用途でも使うWindowsとIE系のUser-Agent値をまとめてみた。(2012年2月現在)
■OS
・WindowsXP
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Trident/4.0)
・WindowsVista
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 6.0; Trident/4.0)
・Windows7
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0)
■ブラウザ
・InternetExplorer 6
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Trident/4.0)
・InternetExplorer 7
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)
・InternetExplorer 8
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
・InternetExplorer 9
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
(追記)
以下のリンク先で、iOSからWii、FireFoxからGoogleのbotさんまでリストされておりました。こっちの方が参考になりますね。
http://www.openspc2.org/userAgent/
なお、1次情報としては以下のリンクのような各ブラウザベンダーの情報をご確認くださいませ。
Microsoftは、結構情報提供に力いれてるね。Iが酷いだけか。
Internet Explorer 8 の User-Agent 文字列 (更新版)
■OS
・WindowsXP
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Trident/4.0)
・WindowsVista
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 6.0; Trident/4.0)
・Windows7
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0)
■ブラウザ
・InternetExplorer 6
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Trident/4.0)
・InternetExplorer 7
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)
・InternetExplorer 8
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
・InternetExplorer 9
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
(追記)
以下のリンク先で、iOSからWii、FireFoxからGoogleのbotさんまでリストされておりました。こっちの方が参考になりますね。
http://www.openspc2.org/userAgent/
なお、1次情報としては以下のリンクのような各ブラウザベンダーの情報をご確認くださいませ。
Microsoftは、結構情報提供に力いれてるね。Iが酷いだけか。
Internet Explorer 8 の User-Agent 文字列 (更新版)
登録:
投稿 (Atom)