1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-08 16:26:29 +02:00

fix: regular expression for testing Webkit based browser (#5453)

* fix: IS_WEBKIT environment symbol excluding blink based browser

* chore: add changeset

* fix: prettier

---------

Co-authored-by: zhanglixin08 <zhanglixin08@meituan.com>
This commit is contained in:
Shiba-ligo
2023-06-17 00:35:32 +08:00
committed by GitHub
parent b01f931942
commit cde0a155e2
2 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
'slate-react': patch
---
fix regular expression for testing Webkit based browser.

View File

@@ -20,7 +20,8 @@ export const IS_FIREFOX =
/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent) /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent)
export const IS_WEBKIT = export const IS_WEBKIT =
typeof navigator !== 'undefined' && /AppleWebKit/.test(navigator.userAgent) typeof navigator !== 'undefined' &&
/AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent)
// "modern" Edge was released at 79.x // "modern" Edge was released at 79.x
export const IS_EDGE_LEGACY = export const IS_EDGE_LEGACY =