mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
parent
dee0f2791e
commit
3c724c2498
@ -243,7 +243,12 @@ export class CRBrowser extends Browser {
|
||||
|
||||
_onDownloadWillBegin(payload: Protocol.Browser.downloadWillBeginPayload) {
|
||||
const page = this._findOwningPage(payload.frameId);
|
||||
assert(page, 'Download started in unknown page: ' + JSON.stringify(payload));
|
||||
if (!page) {
|
||||
// There might be no page when download originates from something unusual, like
|
||||
// a DevTools window or maybe an extension page.
|
||||
// See https://github.com/microsoft/playwright/issues/22551.
|
||||
return;
|
||||
}
|
||||
page.willBeginDownload();
|
||||
|
||||
let originPage = page._initializedPage;
|
||||
|
||||
@ -118,8 +118,7 @@ export class FFBrowser extends Browser {
|
||||
}
|
||||
|
||||
_onDownloadCreated(payload: Protocol.Browser.downloadCreatedPayload) {
|
||||
const ffPage = this._ffPages.get(payload.pageTargetId)!;
|
||||
assert(ffPage);
|
||||
const ffPage = this._ffPages.get(payload.pageTargetId);
|
||||
if (!ffPage)
|
||||
return;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user