UNPKG

874 BJavaScriptView Raw
1export function isCordova(plt) {
2 var win = plt.win();
3 return !!(win['cordova'] || win['PhoneGap'] || win['phonegap']);
4}
5export function isElectron(plt) {
6 return plt.testUserAgent('Electron');
7}
8export function isIos(plt) {
9 // shortcut function to be reused internally
10 // checks navigator.platform to see if it's an actual iOS device
11 // this does not use the user-agent string because it is often spoofed
12 // an actual iPad will return true, a chrome dev tools iPad will return false
13 return plt.testNavigatorPlatform('iphone|ipad|ipod');
14}
15export function isSafari(plt) {
16 return plt.testUserAgent('Safari');
17}
18export function isWKWebView(plt) {
19 return isIos(plt) && !!plt.win()['webkit'];
20}
21export function isIosUIWebView(plt) {
22 return isIos(plt) && !isWKWebView(plt) && !isSafari(plt);
23}
24//# sourceMappingURL=platform-utils.js.map
\No newline at end of file