Attribute | Description |
---|---|
formFactor | Returns a FormFactor enum
value based on the type of hardware the browser is running on.
|
isAndroid | Indicates whether the browser is running on an Android device (true) or not (false). |
isIOS | Not available in all implementations. Indicates whether the browser is running on an iOS device (true) or not (false). |
isIPad | Not available in all implementations. Indicates whether the browser is running on an iPad (true) or not (false). |
isIPhone | Not available in all implementations. Indicates whether the browser is running on an iPhone (true) or not (false). |
isPhone | Indicates whether the browser is running on a phone including a mobile phone with a browser and a smartphone (true), or not (false). |
isTablet | Indicates whether the browser is running on an iPad or a tablet with Android 2.2 or later (true) or not (false). |
isWindowsPhone | Indicates whether the browser is running on a Windows phone (true) or not (false). Note that this only detects Windows phones and does not detect tablets or other touch-enabled Windows 8 devices. |
This example shows usage of the $Browser global value provider.
<aura:component> {!$Browser.isTablet} {!$Browser.isPhone} {!$Browser.isAndroid} {!$Browser.formFactor} </aura:component>
Similarly, you can check browser information in a client-side controller using $A.get().
({ checkBrowser: function(component) { var device = $A.get("$Browser.formFactor"); alert("You are using a " + device); } })