Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Mte90
Last active March 23, 2017 12:43
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mte90/11087393 to your computer and use it in GitHub Desktop.
Save Mte90/11087393 to your computer and use it in GitHub Desktop.
Check if Firefox/Firefox OS/Firefox for Android
//With locationbar.visible check if not in a webview (like an open web app)
if (locationbar.visible) {
//mozApps used for the open web app and with the user agent check if have MObile (used in Firefox OS)
if (navigator.userAgent.indexOf('Firefox') > -1 && navigator.userAgent.indexOf("Mobile") > -1) {
//Check Firefox OS
} else if (navigator.userAgent.indexOf('Firefox') > -1 && navigator.userAgent.indexOf("Android") > -1) {
//Check Firefox for Android
} else if (navigator.userAgent.indexOf("Firefox") > -1) {
//Check Firefox Desktop
}
}
@bernhardsturm
Copy link

Unfortunately this does not work for Android 7 / Firefox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment