in src/chromeProvidedPortConnection.ts [29:39]
public attach(address = '127.0.0.1', port = 9222, targetUrl?: string, timeout = chromeConnection.ChromeConnection.ATTACH_TIMEOUT, extraCRDPChannelPort?: number): Promise<void> {
if (port === 0 && (this.userDataDir === undefined || this.userDataDir === '')) return errors.chromeProvidedPortWithoutUserDataDir();
return utils.retryAsync(async () => {
const launchedPort = (port === 0 && this.userDataDir) ? await this.getLaunchedPort(address, this.userDataDir) : port;
return launchedPort;
}, timeout, /*intervalDelay=*/200)
.catch(err => Promise.reject(err))
.then(launchedPort => {
return super.attach(address, launchedPort, targetUrl, timeout, extraCRDPChannelPort);
});
}