1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

Fix browsers parser

This commit is contained in:
Denis Demchenko 2017-08-20 18:22:28 +03:00
parent 47c6614750
commit 36db325c62

View File

@ -257,12 +257,13 @@ const browsersList = [
}
},
{
test: [/firefox|iceweasel|fxios/i],
test: [/sailfish/i],
describe(ua) {
const browser = {
name: 'Firefox'
name: 'Sailfish'
};
const version = getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.?_?\d+)+)/i, ua);
const version = getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i, ua);
if (version) {
browser.version = version;
@ -391,6 +392,21 @@ const browsersList = [
return browser;
}
},
{
test: [/firefox|iceweasel|fxios/i],
describe(ua) {
const browser = {
name: 'Firefox'
};
const version = getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.?_?\d+)+)/i, ua);
if (version) {
browser.version = version;
}
return browser;
}
},
{
test: [/chromium/i],
describe(ua) {
@ -425,7 +441,7 @@ const browsersList = [
/* Android Browser */
{
test(parser) {
const notLikeAndroid = !parser.test(/^((?!like android).)*$/i);
const notLikeAndroid = !parser.test(/like android/i);
const butAndroid = parser.test(/android/i);
return notLikeAndroid && butAndroid;
},