Skip to content

Commit 09bec79

Browse files
committed
Fix WaitForRequestAsync missing events
1 parent 71cbad6 commit 09bec79

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

UniversalDownloaderPlatform.PuppeteerEngine/PuppeteerCookieRetriever.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,12 @@ protected virtual async Task Login()
9595
page = await browser.NewPageAsync();
9696
}
9797

98-
await page.GoToAsync(_settings.LoginPageAddress);
98+
//no await is done on purpose because otherwise WaitForRequestAsync misses tons of events sometimes including _settings.LoginCheckAddress load
99+
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
100+
page.GoToAsync(_settings.LoginPageAddress, null);
101+
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
99102

100-
await page.WaitForRequestAsync(request => request.Url.Contains(_settings.LoginCheckAddress));
103+
await page.WaitForRequestAsync(request => { return request.Url.Contains(_settings.LoginCheckAddress); });
101104
}
102105
else
103106
{

0 commit comments

Comments
 (0)