Skip to content

Commit c15567c

Browse files
committed
fix(webview): fix error when no webview endpoint is available
1 parent 00edf24 commit c15567c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/commands/contexts.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ export async function getWebViewDetails(this: NovaWindowsDriver, waitForWebviewM
178178

179179
const port = this.webviewDevtoolsPort ??= this.caps.webviewDevtoolsPort ?? null;
180180

181-
const webViewDetails: WebViewDetails = {
182-
info: await cdpRequest.call(this, ({ host, port, endpoint: '/json/version', timeout: 10000 })),
183-
pages: await cdpRequest.call(this, ({ host, port, endpoint: '/json/list', timeout: 10000 })),
184-
};
181+
const info = await (cdpRequest.call(this, ({ host, port, endpoint: '/json/version', timeout: 10000 })) as Promise<CDPVersionResponse>).catch(() => undefined);
182+
const pages = await (cdpRequest.call(this, ({ host, port, endpoint: '/json/list', timeout: 10000 })) as Promise<CDPListResponse>).catch(() => undefined);
183+
184+
const webViewDetails: WebViewDetails = { info, pages };
185185

186186
return webViewDetails;
187187
}

0 commit comments

Comments
 (0)