implement a safari hack for ime (#4186)

remove debug logs

use a better hack

implement a safari hack

extract `isSafari` and `isFirefox` to a global variable
This commit is contained in:
Hailey 2024-05-23 08:45:24 -07:00 committed by GitHub
parent 2c6c906934
commit d051614342
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 30 additions and 6 deletions

6
src/lib/browser.ts Normal file
View file

@ -0,0 +1,6 @@
// https://stackoverflow.com/questions/7944460/detect-safari-browser
export const isSafari = /^((?!chrome|android).)*safari/i.test(
navigator.userAgent,
)
export const isFirefox = /firefox|fxios/i.test(navigator.userAgent)