diff options
Diffstat (limited to 'library/Sortable/src/BrowserInfo.js')
-rw-r--r-- | library/Sortable/src/BrowserInfo.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/library/Sortable/src/BrowserInfo.js b/library/Sortable/src/BrowserInfo.js new file mode 100644 index 000000000..304a853a2 --- /dev/null +++ b/library/Sortable/src/BrowserInfo.js @@ -0,0 +1,12 @@ +function userAgent(pattern) { + if (typeof window !== 'undefined' && window.navigator) { + return !!/*@__PURE__*/navigator.userAgent.match(pattern); + } +} + +export const IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i); +export const Edge = userAgent(/Edge/i); +export const FireFox = userAgent(/firefox/i); +export const Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i); +export const IOS = userAgent(/iP(ad|od|hone)/i); +export const ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i); |