diff --git a/src/crawler.ts b/src/crawler.ts index 4de81062..ffa82fb9 100644 --- a/src/crawler.ts +++ b/src/crawler.ts @@ -1023,7 +1023,11 @@ self.__bx_behaviors.selectMainBehavior(); await textextract.extractAndStoreText("textFinal", true, true); } - if (this.params.screenshot && this.screenshotWriter) { + if ( + this.params.screenshot && + this.screenshotWriter && + this.params.screenshot.includes("fullPageAfterBehaviors") + ) { await page.evaluate(() => { window.scrollTo(0, 0); }); @@ -1033,9 +1037,7 @@ self.__bx_behaviors.selectMainBehavior(); url, writer: this.screenshotWriter, }); - if (this.params.screenshot.includes("fullPageAfterBehaviors")) { - await screenshots.takeFullPageAfterBehaviours(); - } + await screenshots.takeFullPageAfterBehaviours(); } } } diff --git a/src/util/argParser.ts b/src/util/argParser.ts index 30ac6658..83286848 100644 --- a/src/util/argParser.ts +++ b/src/util/argParser.ts @@ -377,7 +377,7 @@ class ArgParser { screenshot: { describe: - "Screenshot options for crawler, can include: view, thumbnail, fullPage, fullPageAfterBehaviors", + "Screenshot options for crawler, can include: view, thumbnail, fullPage, fullPageAfterBehaviors", type: "array", default: [], choices: Array.from(Object.keys(screenshotTypes)),