mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-01-31 17:08:41 +03:00
update
This commit is contained in:
26
resources/web/include/swiper/shared/get-browser.js
Normal file
26
resources/web/include/swiper/shared/get-browser.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import { getWindow } from 'ssr-window';
|
||||
let browser;
|
||||
|
||||
function calcBrowser() {
|
||||
const window = getWindow();
|
||||
|
||||
function isSafari() {
|
||||
const ua = window.navigator.userAgent.toLowerCase();
|
||||
return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0;
|
||||
}
|
||||
|
||||
return {
|
||||
isSafari: isSafari(),
|
||||
isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent)
|
||||
};
|
||||
}
|
||||
|
||||
function getBrowser() {
|
||||
if (!browser) {
|
||||
browser = calcBrowser();
|
||||
}
|
||||
|
||||
return browser;
|
||||
}
|
||||
|
||||
export { getBrowser };
|
||||
Reference in New Issue
Block a user