Skip to content

Commit

Permalink
Update PptrToolkit.ts
Browse files Browse the repository at this point in the history
Bug. browser.pages() will return empty array if multiple fakebrowser instances are opened independently. For example, open two fakebrowser instances in Electron app.
  • Loading branch information
soulkirito authored Jan 10, 2022
1 parent 10381b5 commit e10a19e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/PptrToolkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ export class PptrToolkit {
const start = new Date().getTime()

while (new Date().getTime() - start < timeout) {
const pages = await browser.pages()
const pages = await Promise.all(
browser.targets()
.filter((target) => target.type() === 'page')
.map((target) => target.page())
);
const arr = []

for (const p of pages) {
Expand Down

0 comments on commit e10a19e

Please sign in to comment.