Skip to content

Commit

Permalink
open new page if browser is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed Feb 13, 2024
1 parent 525445e commit bfcdedb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions services/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ async function startAndWarmUpBrowserIfNeeded() {
if (!browserIsOpen) {
console.log('Browser is not open, creating new one')
await browserApi.createNewBrowser()
}
const pageIsOpen = await browserApi.checkIfPageIsOpen()
if (!pageIsOpen) {
console.log('Page is not open, creating new one')
console.log('creating new page also')
await browserApi.createNewPage()
} else {
const pageIsOpen = await browserApi.checkIfPageIsOpen()
if (!pageIsOpen) {
console.log('Page is not open, creating new one')
await browserApi.createNewPage()
}
}
}

Expand Down

0 comments on commit bfcdedb

Please sign in to comment.