Skip to content

a PR about issue #230 #234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ export class Bridge extends EventEmitter {
// set timeout 60000 ms,30000ms always timeout
page.setDefaultTimeout(60000)
// Does this related to(?) the CI Error: exception: Navigation Timeout Exceeded: 30000ms exceeded
await page.goto(url)
await page.goto(url, {
//The polling request on wx.qq.com prevents the page.goto() from reaching the 'load' state, so we use networkidle2 to wait for the page to be fully loaded.
waitUntil: 'networkidle2',
})
log.verbose('PuppetWeChatBridge', 'initPage() after page.goto(url)')

// await this.uosPatch(page)
Expand All @@ -263,7 +266,9 @@ export class Bridge extends EventEmitter {
log.silly('PuppetWeChatBridge', 'initPage() page.setCookie() %s cookies set back', cookieList.length)
}

page.on('load', () => this.emit('load', page))
//page.on('load', () => this.emit('load', page))
//due to polling request on wx.qq.com
page.on('domcontentloaded', () => this.emit('load', page))
await page.reload() // reload page to make effect of the new cookie.

return page
Expand Down