Skip to content

Instantly share code, notes, and snippets.

View Mte90's full-sized avatar
🎯
Creating new open source stuff that you will like

Daniele Scasciafratte Mte90

🎯
Creating new open source stuff that you will like
View GitHub Profile
@Mte90
Mte90 / ffos-check
Last active July 13, 2018 20:45
Check Firefox OS version
function getVersion() {
if (navigator.userAgent.match(/(mobile|tablet)/i)) {
var ffVersionArray = (navigator.userAgent.match(/Firefox\/([\d]+\.[\w]?\.?[\w]+)/));
if (ffVersionArray.length === 2) {
//Check with the gecko version the Firefox OS version
//Table https://developer.mozilla.org/en-US/docs/Gecko_user_agent_string_reference
var hashVersion = {
'18.0': '1.0.1',
'18.1': '1.1',
'26.0': '1.2',
@Mte90
Mte90 / ff-check.js
Last active March 23, 2017 12:43
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
}