You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
486 B
15 lines
486 B
import { window } from 'ssr-window';
|
|
|
|
const Browser = (function Browser() {
|
|
function isSafari() {
|
|
const ua = window.navigator.userAgent.toLowerCase();
|
|
return (ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0);
|
|
}
|
|
return {
|
|
isEdge: !!window.navigator.userAgent.match(/Edge/g),
|
|
isSafari: isSafari(),
|
|
isUiWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent),
|
|
};
|
|
}());
|
|
|
|
export default Browser;
|
|
|