Skip to content

Commit

Permalink
fix: broswer support check (#327)
Browse files Browse the repository at this point in the history
修复safari版本号匹配问题,目前最新版本safari浏览器会提示“您的浏览器版本过低,请升级浏览器”
  • Loading branch information
pcccccc authored and Innei committed Apr 2, 2024
1 parent bfe9a84 commit 622ace7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/browser-support.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TrackerAction } from '~/constants/tracker'
function isSupportedBrowser() {
const ua = navigator.userAgent
const browserRegex = /(?:Chrome|Edg|Firefox|Opera|Safari)\/(\d+)/
const safariRegex = /Version\/(\d+) Safari/ // Safari 浏览器的版本号不同
const safariRegex = /Version\/([\d.]+).*Safari/ // Safari 浏览器的版本号不同

// 检测 Safari
if (ua.includes('Safari') && !ua.includes('Chrome') && !ua.includes('Edg')) {
Expand Down

0 comments on commit 622ace7

Please sign in to comment.