--- title: Platform.js tagline: A platform detection library description: Platform.js - A platform detection library tags: [ Template, Extension ] index: [] categories: [ pages, manuals ] #permalink: /pages/public/start/platform/ regenerate: false resources: [] resource_options: - toccer: collapseDepth: 2 --- // Enable the Liquid Preprocessor // ----------------------------------------------------------------------------- :page-liquid: // Set other global page attributes here // ----------------------------------------------------------------------------- {% comment %} Liquid procedures -------------------------------------------------------------------------------- {% endcomment %} {% capture set_env_entry_document %}themes/{{site.template.name}}/procedures/global/set_env_entry_document.proc{%endcapture%} // NOTE: Initialize entry document paths // ----------------------------------------------------------------------------- {% include {{set_env_entry_document}} init_folders=all %} // Load tag, url and data attributes // ----------------------------------------------------------------------------- include::{includedir}/attributes.asciidoc[tag=tags] include::{includedir}/attributes.asciidoc[tag=urls] include::{includedir}/attributes.asciidoc[tag=data] // Additional Asciidoc page attributes goes here // ----------------------------------------------------------------------------- lorem:sentences[5] pass:[] Home: link:{home-platformjs}[Platform.js, window="_blank"] pass:[] Docs: link:{home-platformjs-docs}[Docs@Platform.js , window="_blank"] == `platform.os` lorem:sentences[5] === platform.os.architecture The CPU architecture the OS is built for. === platform.os.family 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() Returns the OS string. === platform.os.version The version of the OS. == `platform` The platform object. lorem:sentences[5] === platform.description The platform description. === platform.layout The name of the browser's layout engine. The list of common layout engines include: "Blink", "EdgeHTML", "Gecko", "Trident" and "WebKit" === platform.manufacturer 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 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 The name of the operating system. === platform.parse() platform.parse([ua=navigator.userAgent]) Creates a new platform object. ==== Arguments `[ua=navigator.userAgent]` _(Object|string)_ The user agent string or context object. Returns _(Object)_ as a platform object. === platform.prerelease The alpha/beta release indicator. === platform.product 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() 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 The browser's user agent string. === platform.version The browser/environment version.