From 24dd55d9b41b8be19966208873cd81e26c80d44b Mon Sep 17 00:00:00 2001 From: BendingBender Date: Fri, 21 Feb 2014 00:54:32 +0100 Subject: [PATCH] added detection and tests for firefox on firefox os --- src/bowser.js | 4 +++- src/useragents.js | 29 ++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/bowser.js b/src/bowser.js index dbd9de1..cf5022a 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -148,8 +148,10 @@ if (android) { o.android = t o.mobile = t + } else if (!android && firefox && /\((mobile|tablet);.*rv:[\d\.]+\)/i.test(ua)) { + o.firefoxos = t + o.mobile = t } - } else if (android) o = { name: 'Android' diff --git a/src/useragents.js b/src/useragents.js index fbe0cf6..dc908cf 100644 --- a/src/useragents.js +++ b/src/useragents.js @@ -320,7 +320,34 @@ module.exports.useragents = { } } , Firefox: { - 'Mozilla/5.0 (Android; Mobile; rv:27.0) Gecko/27.0 Firefox/27.0': { + 'Mozilla/5.0 (Mobile; rv:26.0) Gecko/26.0 Firefox/26.0': { + mozilla: true + , gecko: true + , firefox: true + , version: '26.0' + , mobile: true + , firefoxos: true + , a: true + } + , 'Mozilla/5.0 (Tablet; rv:26.0) Gecko/26.0 Firefox/26.0': { + mozilla: true + , gecko: true + , firefox: true + , version: '26.0' + , mobile: true + , firefoxos: true + , a: true + } + , 'Mozilla/5.0 (Mobile; LG-D300; rv:18.1) Gecko/18.1 Firefox/18.1': { + mozilla: true + , gecko: true + , firefox: true + , version: '18.1' + , mobile: true + , firefoxos: true + , a: true + } + , 'Mozilla/5.0 (Android; Mobile; rv:27.0) Gecko/27.0 Firefox/27.0': { mozilla: true , gecko: true , firefox: true