From d22d9207cbfd531e253bf0fce281f5d94631d7b5 Mon Sep 17 00:00:00 2001 From: Jose Tavares Date: Sun, 18 Oct 2015 20:21:29 +0100 Subject: [PATCH] fix #100 - Exception with QupZilla --- README.md | 1 + src/bowser.js | 7 +++++++ src/useragents.js | 17 ++++++++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4585f43..8511578 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ if (bowser.msie && bowser.version <= 6) { * Bada browser as `bada`[`webkit`] * Tizen browser as `tizen`[`webkit`] * Sailfish browser as `sailfish`[`gecko`] + * QupZilla browser as `qupzilla`[`webkit`] For all detected browsers the browser version is set in the `version` field. diff --git a/src/bowser.js b/src/bowser.js index cefeee2..83c9bc0 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -168,6 +168,13 @@ , version: getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || versionIdentifier }; } + else if (/qupzilla/i.test(ua)) { + result = { + name: 'QupZilla' + , qupzilla: t + , version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier + } + } else if (/safari/i.test(ua)) { result = { name: 'Safari' diff --git a/src/useragents.js b/src/useragents.js index 9a4263a..e5c5489 100644 --- a/src/useragents.js +++ b/src/useragents.js @@ -970,5 +970,20 @@ module.exports.useragents = { , version: '2.15' , x: true } - } + }, + "QupZilla": { + 'Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/538.1 (KHTML, like Gecko) QupZilla/1.8.2 Safari/538.1': { + qupzilla: true, + version: '1.8.2', + webkit: true, + x: true + }, + 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) QupZilla/1.8.6 Safari/537.21': { + qupzilla: true, + version: '1.8.6', + webkit: true, + x: true + } + +} };