Initial release
Some checks failed
My Build All / build_windows (push) Has been cancelled
My Build All / build_linux_portable (push) Has been cancelled
My Build All / build_linux_appimage (push) Has been cancelled
My Build All / build_macos (push) Has been cancelled
My Build All / Publish release assets (push) Has been cancelled
Shellcheck / Shellcheck (push) Has been cancelled
Some checks failed
My Build All / build_windows (push) Has been cancelled
My Build All / build_linux_portable (push) Has been cancelled
My Build All / build_linux_appimage (push) Has been cancelled
My Build All / build_macos (push) Has been cancelled
My Build All / Publish release assets (push) Has been cancelled
Shellcheck / Shellcheck (push) Has been cancelled
This commit is contained in:
commit
c661ddc2eb
16967 changed files with 4075897 additions and 0 deletions
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 };
|
||||
Loading…
Add table
Add a link
Reference in a new issue