Skip to content

Commit 7e74d11

Browse files
committed
bugbot
1 parent e8a3c05 commit 7e74d11

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

templates/typescript/advanced-sample/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ app.action("test-captcha-solver", async (ctx: KernelContext): Promise<void> => {
3939
);
4040

4141
// Navigate to a site with a CAPTCHA
42-
const context = (await browser.contexts()[0]) || (await browser.newContext());
43-
const page = (await context.pages()[0]) || (await context.newPage());
42+
const context = browser.contexts()[0] || (await browser.newContext());
43+
const page = context.pages()[0] || (await context.newPage());
4444
await page.waitForTimeout(10000); // Add a delay to give you time to visit the live view url
4545
await page.goto("https://www.google.com/recaptcha/api2/demo");
4646
// Watch Kernel auto-solve the CAPTCHA!

templates/typescript/sample-app/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ app.action<PageTitleInput, PageTitleOutput>(
5959
);
6060

6161
const browser = await chromium.connectOverCDP(kernelBrowser.cdp_ws_url);
62-
const context =
63-
(await browser.contexts()[0]) || (await browser.newContext());
64-
const page = (await context.pages()[0]) || (await context.newPage());
62+
const context = browser.contexts()[0] || (await browser.newContext());
63+
const page = context.pages()[0] || (await context.newPage());
6564

6665
try {
6766
//////////////////////////////////////

0 commit comments

Comments
 (0)