mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-20 21:53:56 +00:00
Clean up and fix
This commit is contained in:
@@ -543,6 +543,7 @@ export class Login {
|
||||
await this.bot.utils.wait(500) // Increased from 250ms
|
||||
|
||||
// IMPROVEMENT: Wait for page to be fully ready before looking for email field
|
||||
// Silent catch justified: DOMContentLoaded may already be complete, which is fine
|
||||
await page.waitForLoadState('domcontentloaded', { timeout: 10000 }).catch(() => {})
|
||||
await this.bot.utils.wait(300) // Extra settling time
|
||||
|
||||
@@ -572,6 +573,7 @@ export class Login {
|
||||
const content = await page.content().catch(() => '')
|
||||
if (content.length < 1000) {
|
||||
this.bot.log(this.bot.isMobile, 'LOGIN', 'Page content too small, reloading...', 'warn')
|
||||
// Silent catch justified: Reload may timeout if page is slow, but we continue anyway
|
||||
await page.reload({ waitUntil: 'domcontentloaded', timeout: 15000 }).catch(() => {})
|
||||
await this.bot.utils.wait(1500)
|
||||
}
|
||||
|
||||
@@ -387,7 +387,8 @@ export class Search extends Workers {
|
||||
|
||||
private async clickRandomLink(page: Page) {
|
||||
try {
|
||||
await page.click('#b_results .b_algo h2', { timeout: 2000 }).catch(() => { }) // Since we don't really care if it did it or not
|
||||
// Silent catch justified: Click is best-effort humanization, failure is acceptable
|
||||
await page.click('#b_results .b_algo h2', { timeout: 2000 }).catch(() => {})
|
||||
|
||||
// Only used if the browser is not the edge browser (continue on Edge popup)
|
||||
await this.closeContinuePopup(page)
|
||||
|
||||
Reference in New Issue
Block a user