Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private async _ensureBrowserWindowDescriptor (browserId: string): Promise {
if (this._getWindowDescriptor(browserId))
return;
await this._ensureLocalBrowserInfo(browserId);
// NOTE: delay to ensure the window finished the opening
await this.plugin.waitForConnectionReady(browserId);
await delay(BROWSER_OPENING_DELAY);
if (this.localBrowsersInfo[browserId])
this.localBrowsersInfo[browserId].windowDescriptor = await browserTools.findWindow(browserId);
}
() => findWindow(''),
errors.UnableToAccessScreenRecordingAPIError,
async openBrowser (browserId) {
if (!this.canDetectLocalBrowsers)
return;
await this.waitForConnectionReady(browserId);
const localBrowserWindow = await findWindow(browserId);
this.localBrowsersFlags[browserId] = localBrowserWindow !== null;
},