fix(webkit): make interception tests pass

This commit is contained in:
Yury Semikhatsky 2020-01-16 16:53:52 -08:00
parent a446d919fd
commit d6d35178e3

View file

@ -64,9 +64,19 @@ export class WKPageProxy {
this._pageProxySession.dispatchMessage(message); 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) { handleProvisionalLoadFailed(event: Protocol.Browser.provisionalLoadFailedPayload) {
if (!this._wkPage) if (!this._wkPage)
return; return;
if (!this._isProvisionalCrossProcessLoadInProgress())
return;
let errorText = event.error; let errorText = event.error;
if (errorText.includes('cancelled')) if (errorText.includes('cancelled'))
errorText += '; maybe frame was detached?'; errorText += '; maybe frame was detached?';