From 4a02b9aef596d98212ec79f5ba4b9ddf62a89bab Mon Sep 17 00:00:00 2001 From: Elbert Alias <77259+AliasIO@users.noreply.github.com> Date: Thu, 7 Jan 2021 11:09:21 +1100 Subject: [PATCH] Analyze JS a second time after a 5s delay to capture async scripts --- src/drivers/webextension/js/content.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/drivers/webextension/js/content.js b/src/drivers/webextension/js/content.js index e6ccb4c96..883b38247 100644 --- a/src/drivers/webextension/js/content.js +++ b/src/drivers/webextension/js/content.js @@ -92,7 +92,14 @@ const Content = { language, ]) - Content.onGetTechnologies(await Content.driver('getTechnologies')) + const technologies = await Content.driver('getTechnologies') + + Content.onGetTechnologies(technologies) + + // Delayed second pass to capture async JS + await new Promise((resolve) => setTimeout(resolve, 5000)) + + Content.onGetTechnologies(technologies) } catch (error) { Content.driver('error', error) }