diff --git a/.version b/.version index 7b11d3b..85162da 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -v10.3.0 +v10.3.1 diff --git a/package.json b/package.json index 4a11405..68e13b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ohzi-core", - "version": "10.3.0", + "version": "10.3.1", "description": "OHZI Core Library", "source": "src/index.js", "module": "build/index.module.js", diff --git a/src/Browser.js b/src/Browser.js index 0eed1b5..6efd075 100644 --- a/src/Browser.js +++ b/src/Browser.js @@ -84,6 +84,7 @@ class Browser let version = 0; let M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; + if (/trident/i.test(M[1])) { tem = /\brv[ :]+(\d+)/g.exec(ua) || []; @@ -94,8 +95,10 @@ class Browser tem = ua.match(/\b(OPR|Edge)\/(\d+)/); if (tem != null) version = tem.slice(1).join(' ').replace('OPR', 'Opera'); } + M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?']; - if ((tem = ua.match(/version\/(\d+)/i)) != null) M.splice(1, 1, tem[1]); + if ((tem = ua.match(/version\/(\d+(\.\d+)?)/i)) != null) M.splice(1, 1, tem[1]); + version = M.join(' '); return Number(version.split(' ')[1]);