Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'ios-webkit-debug-proxy. If you expect to find webviews, please ensure ' +
'that the proxy is running and accessible');
this.remote = null;
pageArray = [];
}
} else {
// simulator, and not connected
this.remote = await this.getNewRemoteDebugger();
let appInfo = await this.remote.connect();
if (!appInfo) {
logger.debug('Unable to connect to the remote debugger.');
return [];
}
pageArray = await this.remote.selectApp(currentUrl, this.opts.webviewConnectRetries, this.opts.ignoreAboutBlankUrl);
this.remote.on(RemoteDebugger.EVENT_PAGE_CHANGE, this.onPageChange.bind(this));
this.remote.on(RemoteDebugger.EVENT_FRAMES_DETACHED, () => {
if (!_.isEmpty(this.curWebFrames)) {
logger.debug(`Clearing ${this.curWebFrames.length} frames: ${this.curWebFrames.join(', ')}`);
}
this.curWebFrames = [];
});
let tryClosingAlert = async () => {
let didDismiss = await this.closeAlertBeforeTest();
if (!didDismiss) {
throw new Error('Close alert failed. Retry.');
}
};
try {
await retryInterval(3, 4000, tryClosingAlert);
} catch (err) {
extensions.connectToRemoteDebugger = async function connectToRemoteDebugger () {
this.remote = await this.getNewRemoteDebugger();
await this.remote.connect();
this.remote.on(RemoteDebugger.EVENT_PAGE_CHANGE, this.onPageChange.bind(this));
this.remote.on(RemoteDebugger.EVENT_FRAMES_DETACHED, () => {
if (!_.isEmpty(this.curWebFrames)) {
log.debug(`Clearing ${this.curWebFrames.length} frames: ${this.curWebFrames.join(', ')}`);
}
this.curWebFrames = [];
});
};