Permalink
dbddee1 Mar 31, 2017
@jdalton @bnjmntn
273 lines (171 sloc) 6.4 KB

Platform.js v1.3.4

platform

platform.os

platform

platform

[Ⓢ](https://github.com/bestiejs/platform.js/blob/1.3.4/platform.js#L1038 "View in source") [Ⓣ][1]

The platform object.


platform.description

[Ⓢ](https://github.com/bestiejs/platform.js/blob/1.3.4/platform.js#L1046 "View in source") [Ⓣ][1]

The platform description.


platform.layout

[Ⓢ](https://github.com/bestiejs/platform.js/blob/1.3.4/platform.js#L1057 "View in source") [Ⓣ][1]

The name of the browser's layout engine.

The list of common layout engines include:
"Blink", "EdgeHTML", "Gecko", "Trident" and "WebKit"


platform.manufacturer

[Ⓢ](https://github.com/bestiejs/platform.js/blob/1.3.4/platform.js#L1070 "View in source") [Ⓣ][1]

The name of the product's manufacturer.

The list of manufacturers include:
"Apple", "Archos", "Amazon", "Asus", "Barnes & Noble", "BlackBerry", "Google", "HP", "HTC", "LG", "Microsoft", "Motorola", "Nintendo", "Nokia", "Samsung" and "Sony"


platform.name

[Ⓢ](https://github.com/bestiejs/platform.js/blob/1.3.4/platform.js#L1086 "View in source") [Ⓣ][1]

The name of the browser/environment.

The list of common browser names include:
"Chrome", "Electron", "Firefox", "Firefox for iOS", "IE", "Microsoft Edge", "PhantomJS", "Safari", "SeaMonkey", "Silk", "Opera Mini" and "Opera"

Mobile versions of some browsers have "Mobile" appended to their name:
eg. "Chrome Mobile", "Firefox Mobile", "IE Mobile" and "Opera Mobile"


platform.os

[Ⓢ](https://github.com/bestiejs/platform.js/blob/1.3.4/platform.js#L1131 "View in source") [Ⓣ][1]

The name of the operating system.


platform.parse([ua=navigator.userAgent])

[Ⓢ](https://github.com/bestiejs/platform.js/blob/1.3.4/platform.js#L253 "View in source") [Ⓣ][1]

Creates a new platform object.

Arguments

  1. [ua=navigator.userAgent] (Object|string): The user agent string or context object.

Returns

(Object): A platform object.


platform.prerelease

[Ⓢ](https://github.com/bestiejs/platform.js/blob/1.3.4/platform.js#L1094 "View in source") [Ⓣ][1]

The alpha/beta release indicator.


platform.product

[Ⓢ](https://github.com/bestiejs/platform.js/blob/1.3.4/platform.js#L1107 "View in source") [Ⓣ][1]

The name of the product hosting the browser.

The list of common products include:

"BlackBerry", "Galaxy S4", "Lumia", "iPad", "iPod", "iPhone", "Kindle", "Kindle Fire", "Nexus", "Nook", "PlayBook", "TouchPad" and "Transformer"


platform.toString()

[Ⓢ](https://github.com/bestiejs/platform.js/blob/1.3.4/platform.js#L610 "View in source") [Ⓣ][1]

Returns platform.description when the platform object is coerced to a string.

Returns

(string): Returns platform.description if available, else an empty string.


platform.ua

[Ⓢ](https://github.com/bestiejs/platform.js/blob/1.3.4/platform.js#L1115 "View in source") [Ⓣ][1]

The browser's user agent string.


platform.version

[Ⓢ](https://github.com/bestiejs/platform.js/blob/1.3.4/platform.js#L1123 "View in source") [Ⓣ][1]

The browser/environment version.


platform.os

platform.os.architecture

[Ⓢ](https://github.com/bestiejs/platform.js/blob/1.3.4/platform.js#L1139 "View in source") [Ⓣ][1]

The CPU architecture the OS is built for.


platform.os.family

[Ⓢ](https://github.com/bestiejs/platform.js/blob/1.3.4/platform.js#L1152 "View in source") [Ⓣ][1]

The family of the OS.

Common values include:
"Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista", "Windows XP", "OS X", "Ubuntu", "Debian", "Fedora", "Red Hat", "SuSE", "Android", "iOS" and "Windows Phone"


platform.os.toString()

[Ⓢ](https://github.com/bestiejs/platform.js/blob/1.3.4/platform.js#L1168 "View in source") [Ⓣ][1]

Returns the OS string.

Returns

(string): The OS string.


platform.os.version

[Ⓢ](https://github.com/bestiejs/platform.js/blob/1.3.4/platform.js#L1160 "View in source") [Ⓣ][1]

The version of the OS.