Skip to content

Commit

Permalink
Solving typescript compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoooqq committed Jan 12, 2022
1 parent 02eac96 commit c0c98b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fakebrowser",
"version": "0.0.64",
"version": "0.0.65",
"description": "🤖 Fake fingerprints to bypass anti-bot systems. Simulate mouse and keyboard operations to make behavior like a real person.",
"repository": {
"type": "git",
Expand Down
12 changes: 7 additions & 5 deletions src/core/PptrToolkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class PptrToolkit {
return null
}

static async getActivePage(browser: Browser, timeout = 10 * 1000): Promise<Page> {
static async getActivePage(browser: Browser, timeout = 10 * 1000): Promise<Page | null> {
const start = new Date().getTime()

while (new Date().getTime() - start < timeout) {
Expand All @@ -173,10 +173,12 @@ export class PptrToolkit {
const arr = []

for (const p of pages) {
if (await p.evaluate(() => {
return document.visibilityState == 'visible'
})) {
arr.push(p)
if (p) {
if (await p.evaluate(() => {
return document.visibilityState == 'visible'
})) {
arr.push(p)
}
}
}

Expand Down

0 comments on commit c0c98b6

Please sign in to comment.