From 4ce6f66ad097c6c310128419dd25e6a450cb171a Mon Sep 17 00:00:00 2001 From: terjanq Date: Fri, 17 Jun 2022 17:17:24 +0200 Subject: [PATCH] Revert to await but add timeout instead. (#377) Reverts back to await, though if someone is smart they can get `timeout + 1.5` seconds of execution time. --- dist/challenge-templates/xss-bot/challenge/bot.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/challenge-templates/xss-bot/challenge/bot.js b/dist/challenge-templates/xss-bot/challenge/bot.js index 576a5218..415db9ad 100755 --- a/dist/challenge-templates/xss-bot/challenge/bot.js +++ b/dist/challenge-templates/xss-bot/challenge/bot.js @@ -53,7 +53,9 @@ if (BLOCK_SUBORIGINS) { const page = await context.newPage(); await page.setCookie(cookie); socket.write(`Loading page ${url}.\n`); - page.goto(url); + await page.goto(url, { + timeout: 1500 /* add 1.5s margin for network delays */ + }); setTimeout(()=>{ try { context.close();