From 921ceaa124defa200f0d16ffcc1e57553213c17d Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Fri, 22 May 2020 20:35:22 +0200 Subject: avoid waiting for external resources --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'index.js') diff --git a/index.js b/index.js index 75fe2ec..90123ac 100644 --- a/index.js +++ b/index.js @@ -15,9 +15,9 @@ const app = new Koa(); app.use(async ctx => { if (ctx.query.url) { const page = await browser.newPage(); - await page.goto(ctx.query.url); + await page.goto(ctx.query.url, {timeout: 30000, waitUntil: 'domcontentloaded'}); if ((await page.content()).includes("cf-browser-verification")) - await page.waitForNavigation(); + await page.waitForNavigation({timeout: 30000, waitUntil: 'domcontentloaded'}); ctx.body = await page.content(); await page.close(); } -- cgit v1.2.3