SystemInfo について

もはやブラウザーを判定する必要がないので更新されていません。

JavaScript で書かれた Web ブラウザーの判定スクリプトです。最近ではほとんどの環境がレンダリング結果の差異が小さいモダンブラウザーに置き換わりつつあり、ブラウザーを判定する必要は薄れてきていますが、アクセス解析なんかでは未だ使えると思います。

UserAgent 以外にもブラウザーが持つ固有のオブジェクトも含めて判定しているため、いくつかの UserAgent 偽装を検出することができます。また、PlayStation Portable の独自拡張にも対応しており、UserAgent に含まれていない情報も追加で取得することができます。

ダウンロード

ソースコードは chitoku-k/SystemInfo (GitHub) からどうぞ。

使い方

  1. SystemInfo のソースを読み込みます。お使いのサーバーにアップロードした上でそのファイルを指定してください。
<script src="systeminfo.js" charset="utf-8"></script>
  1. SystemInfo のインスタンスを作成します。info の部分は自由に指定できます。
var info = new SystemInfo();
  1. インスタンスの判定結果を参照します。取得できない項目には undefined が入ります。
// ブラウザーの名前 (Internet Explorer, Firefox, Google Chrome など - String)
document.write(info.browser.name);

// ブラウザーのバージョン (10.0, 28.0.1500.52 など - String)
document.write(info.browser.version);

// ブラウザーのエンジン (Trident, Gecko, WebKit, Presto - String)
document.write(info.browser.code);
// OS の名前 (Windows, Mac OS X, iOS, Android など - String)
document.write(info.os.name);

// OS のバージョン (NT 6.2, 10.8.2 など - String)
document.write(info.os.version);

// OS のプラットフォーム (WOW64 など - String)
document.write(info.os.platfrom);
// デバイスの名前 (Kindle Fire HD, PlayStation Portable など - String)
document.write(info.device.name);
// UserAgent 偽装 (true / false - Boolean)
document.write(info.userAgent.isFake);
  1. PSP の詳細情報に対応する場合は、systeminfo.js を読み込むより前に次のコードを挿入します。JavaScript の document.write による書き出しでも機能します。
<object name="pspext" type="application/x-psp-extplugin"></object>

仕様

オブジェクト

プロパティー

browser

name

Internet Explorer

Firefox

Google Chrome

Safari

Opera

Netscape Navigator

Netscape Browser

Netscape

Netscape Communicator

Mozilla

NetFront

version

・x.x
・x.x (IE 7 Compatibility View)
・x.x (IE x Mode)

code

Trident

Gecko

WebKit

Blink

Presto

os

name

Windows 8.1

Windows 8

Windows 7

Windows Vista

Windows XP

Windows 2000

Windows Me

Windows 98

Windows NT

Windows 95

Windows

Windows Phone

Mac OS X

Mac OS

iOS

Android

Ubuntu

Linux

FreeBSD

NetBSD

OpenBSD

Solaris

PSP

PS Vita

version

NT x.x

(任意の文字列)

platform

WOW64

(任意の文字列)

device

name

iPhone

iPod

iPad

Kindle Fire (1st gen.)

Kindle Fire (2nd gen.)

Kindle Fire HD

Kindle Fire HD 8.9

(任意の文字列)

Nintendo Wii

Nintendo DSi

Nintendo 3DS

Nintendo DS

PlayStation Portable

PlayStation Vita

PlayStation 3

PlayStation 2