From c1db0826297f756c7ddcce320a8c4e0973418459 Mon Sep 17 00:00:00 2001 From: LJQ Date: Mon, 27 May 2024 02:55:00 +0800 Subject: [PATCH] Fix ua detection --- src/scripts/browser.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/scripts/browser.js b/src/scripts/browser.js index 80f8cec281..b2ebccaabc 100644 --- a/src/scripts/browser.js +++ b/src/scripts/browser.js @@ -188,13 +188,15 @@ function supportsCssAnimation(allowPrefix) { const uaMatch = function (ua) { ua = ua.toLowerCase(); - const match = /(chrome)[ /]([\w.]+)/.exec(ua) - || /(edg)[ /]([\w.]+)/.exec(ua) + ua = ua.replace(/(motorola edge)/, '').trim(); + + const match = /(edg)[ /]([\w.]+)/.exec(ua) || /(edga)[ /]([\w.]+)/.exec(ua) || /(edgios)[ /]([\w.]+)/.exec(ua) || /(edge)[ /]([\w.]+)/.exec(ua) || /(opera)[ /]([\w.]+)/.exec(ua) || /(opr)[ /]([\w.]+)/.exec(ua) + || /(chrome)[ /]([\w.]+)/.exec(ua) || /(safari)[ /]([\w.]+)/.exec(ua) || /(firefox)[ /]([\w.]+)/.exec(ua) || ua.indexOf('compatible') < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)