警告:
この記事の内容は古くなっている可能性があります。
概要
navigator オブジェクトへの参照を返します。 navigator オブジェクトを用いることで、スクリプトを実行しているアプリケーションについての情報を得ることができます。
例
プロパティ
navigator.appCodeName
- 現在のブラウザの内部 "コード" ネームを返す(※このプロパティは正確な値を返すとは限りません)
navigator.appName
- ブラウザの正式名称を返す(※このプロパティは正確な値を返すとは限りません)
navigator.appVersion
- ブラウザのバージョンを表す文字列を返す(※このプロパティは正確な値を返すとは限りません)
navigator.buildID
- ブラウザのビルド識別子を返す(※例: "2006090803")
navigator.connection
- Provides information about the network connection of a device.
navigator.cookieEnabled
- ブラウザのクッキーが有効かどうかを示す真偽値を返す
navigator.doNotTrack
- Reports the value of the user's do-not-track preference. When this value is "yes", your web site or application should not track the user.
navigator.id
- Returns the
id
object which you can use to add support for BrowserID to your web site. navigator.language
- ブラウザの言語バージョンを表す文字列を返す
navigator.mimeTypes
- ブラウザがサポートしている MIME タイプの一覧を返す
navigator.mozApps
- Returns an
Apps
object you can use to install, manage, and control Open Web apps. navigator.battery
- Returns a
battery
object you can use to get information about the battery charging status. navigator.mozNotification
navigator.webkitNotification
- Returns a
notification
object you can use to deliver notifications to the user from your web application. navigator.mozSms
- Returns a
SmsManager
object you can use to manage SMS messaging in your web application. navigator.mozSocial
- FIXME:
navigator.mozTelephony
- Returns a
Telephony
object you can use to create and manage telephone calls. navigator.onLine
- ブラウザがオンラインで動作しているかどうかを示す真偽値を返す
navigator.oscpu
- 現在のオペレーティングシステムを表す文字列を返す
navigator.platform
- ブラウザのプラットフォームを表す文字列を返す
navigator.plugins
- ブラウザにインストールされているプラグインの一覧を配列で返す
navigator.product
- 現在のブラウザの製品名を返す(※例:"Gecko")
navigator.productSub
- 現在のブラウザのビルド番号を返します(※例:"20060909")
navigator.securitypolicy
- 空文字列を返す(※Netscape 4.7x のみ "US & CA domestic policy" または、 "Export policy" という文字列を返す)
navigator.standalone
- Returns a boolean indicating whether the browser is running in standalone mode. Available on Apple's iOS Safari only.
navigator.userAgent
- 現在のブラウザのユーザエージェントを表す文字列を返す
navigator.vendor
- 現在のブラウザのベンダー名を返す(※例:"Netscape6")
navigator.vendorSub
- ベンダーバージョン番号を返す(※例:"6.1")
navigator.webkitPointer
- Returns a PointerLock object for the Mouse Lock API.
メソッド
navigator.javaEnabled
- ホストブラウザで Java が有効かどうかを示す
navigator.mozIsLocallyAvailable
- 指定 URI の文書がネットワークを利用しなくても閲覧可能かどうかをチェックする
navigator.preference
Gecko 2.0 で廃止- ユーザ設定を設定する。このメソッドは、特権を持つコードでのみ使用可能です。現在は廃止されているため、代わりに XPCOM の Preferences API を用います。
navigator.registerContentHandler
- Web サイトを指定した MIME タイプに関連付ける
navigator.registerProtocolHandler
- Web サイト を指定したプロトコルに関連付ける
navigator.taintEnabled
非推奨 Gecko 1.7.8 Gecko 9.0 で廃止false
を返す。JavaScript の taint/untaint 関数は、JavaScript 1.2 で削除されています(※)navigator.vibrate()
- Causes vibration on devices with support for it. Does nothing if vibration support isn't available.