From 06a72df7a7a6e1a0f38536bba52af52839d714be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E8=B0=B7=E5=89=91=E4=BB=99?= Date: Mon, 16 Aug 2021 19:42:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E8=A7=89=E5=BE=97=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E6=97=A0=E6=89=80=E8=B0=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- browser-compatibility.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browser-compatibility.js b/browser-compatibility.js index 57f70dc3..02c89884 100644 --- a/browser-compatibility.js +++ b/browser-compatibility.js @@ -12,10 +12,10 @@ if (needUpdateBrowser) { let browserVersion = ((UA)=>{ let regRes; - if (regRes = /(Firefox|Chrome)\/([\d\.]+)/ig.exec(navigator.userAgent)) + if (regRes = /\b(Firefox|Chrome)\/([\d\.]+)/ig.exec(navigator.userAgent)) { return `${regRes[1]} ${regRes[2]}`; - }else if (regRes = /Version\/([\d\.]+)\s+.*(\bSafari)\//ig.exec(navigator.userAgent)) + }else if (regRes = /\bVersion\/([\d\.]+)\s+.*\b(Safari)\//ig.exec(navigator.userAgent)) { return `${regRes[2]} ${regRes[1]}`; }else