Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const IPHONE_LANDSCAPE_TOP_BAR_HEIGHT = 51;
const IPHONE_BOTTOM_BAR_OFFSET = 49;
const TAB_BAR_OFFSET = 33;
const IPHONE_WEB_COORD_SMART_APP_BANNER_OFFSET = 84;
const IPAD_WEB_COORD_SMART_APP_BANNER_OFFSET = 95;
const IPHONE_X_WIDTH = 375;
const IPHONE_X_HEIGHT = 812;
const IPHONE_XR_WIDTH = 414;
const IPHONE_XR_HEIGHT = 896;
const ATOM_WAIT_TIMEOUT = 5 * 60000;
let extensions = {};
Object.assign(extensions, iosCommands.web);
extensions.getSafariIsIphone = _.memoize(async function getSafariIsIphone () {
try {
const userAgent = await this.execute('return navigator.userAgent');
return userAgent.toLowerCase().includes('iphone');
} catch (err) {
log.warn(`Unable to find device type from useragent. Assuming iPhone`);
log.debug(`Error: ${err.message}`);
}
return true;
});
extensions.getSafariIsIphoneX = _.memoize(async function getSafariIsIphone () {
try {