fix(webkit): make interception tests pass (#516)

This commit is contained in:
Yury Semikhatsky 2020-01-16 17:00:02 -08:00 committed by GitHub
parent 057e466a65
commit 6a0dba7b56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,9 +64,19 @@ export class WKPageProxy {
this._pageProxySession.dispatchMessage(message);
}
private _isProvisionalCrossProcessLoadInProgress() : boolean {
for (const anySession of this._sessions.values()) {
if ((anySession as any)[provisionalMessagesSymbol])
return true;
}
return false;
}
handleProvisionalLoadFailed(event: Protocol.Browser.provisionalLoadFailedPayload) {
if (!this._wkPage)
return;
if (!this._isProvisionalCrossProcessLoadInProgress())
return;
let errorText = event.error;
if (errorText.includes('cancelled'))
errorText += '; maybe frame was detached?';