mirror of
https://github.com/lancedikson/bowser
synced 2024-10-27 20:34:22 +00:00
fix regexp selection order
This commit is contained in:
parent
2dcfca1388
commit
b8d60f7593
@ -597,7 +597,7 @@ const browsersList = [
|
|||||||
const regexpWithoutDeviceSpec = /^(.*)\/(.*) /;
|
const regexpWithoutDeviceSpec = /^(.*)\/(.*) /;
|
||||||
const regexpWithDeviceSpec = /^(.*)\/(.*)[ \t]\((.*)/;
|
const regexpWithDeviceSpec = /^(.*)\/(.*)[ \t]\((.*)/;
|
||||||
const hasDeviceSpec = ua.search('\\(') !== -1;
|
const hasDeviceSpec = ua.search('\\(') !== -1;
|
||||||
const regexp = hasDeviceSpec ? regexpWithoutDeviceSpec : regexpWithDeviceSpec;
|
const regexp = hasDeviceSpec ? regexpWithDeviceSpec : regexpWithoutDeviceSpec;
|
||||||
return {
|
return {
|
||||||
name: Utils.getFirstMatch(regexp, ua),
|
name: Utils.getFirstMatch(regexp, ua),
|
||||||
version: Utils.getSecondMatch(regexp, ua),
|
version: Utils.getSecondMatch(regexp, ua),
|
||||||
|
Loading…
Reference in New Issue
Block a user