diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index 0e7de42..e7ca426 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -833,13 +833,13 @@ class CommandorPage { logWithDevice("get pages", this.device) let pages = await this.browser.pages(); - let needPages = pages.filter(currentPage => currentPage.url() === RDV_URL) - this.page = needPages[0] - // pages.forEach((currentPage) => { - // if (currentPage.url() === RDV_URL) { - // this.page = currentPage; - // } - // }) + // let needPages = pages.filter(currentPage => currentPage.url() === RDV_URL) + // this.page = needPages[0] + pages.forEach((currentPage) => { + if (currentPage.url() === RDV_URL) { + this.page = currentPage; + } + }) logWithDevice("this.page.bringToFront();", this.device) await this.page.bringToFront(); @@ -858,8 +858,13 @@ class CommandorPage { logWithDevice("get pages", this.device) let pages = await this.browser.pages(); logWithDevice("get current page", this.device) - let needPages = pages.filter(currentPage => currentPage.url() === RDV_URL) - this.page = needPages[0] + // let needPages = pages.filter(currentPage => currentPage.url() === RDV_URL) + // this.page = needPages[0] + pages.forEach((currentPage) => { + if (currentPage.url() === RDV_URL) { + this.page = currentPage; + } + }) logWithDevice("this.page.bringToFront();", this.device) await this.page.bringToFront(); // this.page = pages;