navigator Object

By: Dusty Arlia
Published on Wednesday, July 24, 2013, 09:08 AM
Last Updated on Sunday, July 12, 2015 at 3:12 PM
Total Updates: 2

One of the objects in the browser object model (BOM) is the navigator object. The navigator object is used to access information about the visitor's web browser. Through the navigator object, you can find out what browser your visitor is using and what version of that browser. You can also see what plugins they are using.

Here is the JavaScript code to enumerate the navigator object's properties:

for (propt in navigator) {
document.write("Navigator property: " + propt + " = " + navigator[propt] + "<br />\n"); 
}

And here is the output of navigator's properties. I'm using Google Chrome:

Navigator property: geolocation = [object Geolocation]
Navigator property: webkitPersistentStorage = [object StorageQuota]
Navigator property: webkitTemporaryStorage = [object StorageQuota]
Navigator property: onLine = true
Navigator property: cookieEnabled = true
Navigator property: vendorSub = 
Navigator property: vendor = Google Inc.
Navigator property: productSub = 20030107
Navigator property: product = Gecko
Navigator property: mimeTypes = [object MimeTypeArray]
Navigator property: plugins = [object PluginArray]
Navigator property: platform = Win32
Navigator property: userAgent = Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36
Navigator property: language = en-US
Navigator property: appVersion = 5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36
Navigator property: appName = Netscape
Navigator property: appCodeName = Mozilla
Navigator property: doNotTrack = null
Navigator property: javaEnabled = function javaEnabled() { [native code] }
Navigator property: getStorageUpdates = function getStorageUpdates() { [native code] }
Navigator property: registerProtocolHandler = function registerProtocolHandler() { [native code] }
Navigator property: webkitGetGamepads = function webkitGetGamepads() { [native code] }
Navigator property: webkitGetUserMedia = function webkitGetUserMedia() { [native code] }

Comments:

Ad: