From ab6d3165da2639586cad58f2b248d7590ae81aa1 Mon Sep 17 00:00:00 2001 From: Lluis Date: Tue, 13 Feb 2024 15:47:52 +0100 Subject: [PATCH] always check if browser and page are opened --- services/browser.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/browser.js b/services/browser.js index 42687b6..5fb6f6b 100644 --- a/services/browser.js +++ b/services/browser.js @@ -4,10 +4,9 @@ require('mathjs') async function getScreenshot() { let bufferImage try { - await browserApi.getPage() + await this.startAndWarmUpBrowserIfNeeded() } catch (error) { console.log(error) - await this.startAndWarmUpBrowserIfNeeded() return null } const name = Math.random().toString(36).substring(2,8)