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.
25 lines
359 B
25 lines
359 B
let browser;
|
|
|
|
function calcBrowser() {
|
|
function isSafari() {
|
|
const res = uni.getSystemInfoSync();
|
|
return res.model;
|
|
}
|
|
|
|
return {
|
|
isSafari: isSafari(),
|
|
isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(isSafari())
|
|
};
|
|
}
|
|
|
|
function getBrowser() {
|
|
if (!browser) {
|
|
browser = calcBrowser();
|
|
}
|
|
|
|
return browser;
|
|
}
|
|
|
|
export {
|
|
getBrowser
|
|
};
|
|
|