Skip to content

Commit 6d2b35b

Browse files
authored
chore(chromium): link the crbug for detaching without resuming (#43667)
1 parent 7a048a9 commit 6d2b35b

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

‎packages/playwright-core/src/server/chromium/crConnection.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ export class CRSession extends SdkObject<Protocol.EventMap & ConnectionEventMap>
190190
throw new Error('Root session cannot be closed');
191191
// Ideally, detaching should resume any target, but there is a bug in the backend,
192192
// so we must Runtime.runIfWaitingForDebugger first.
193+
// See https://issues.chromium.org/issues/578112291.
193194
await this._sendMayFail('Runtime.runIfWaitingForDebugger');
194195
await this._parentSession.send('Target.detachFromTarget', { sessionId: this._sessionId });
195196
this.dispose();

‎packages/playwright-core/src/server/chromium/crPage.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,8 @@ class FrameSession {
790790
if (event.targetInfo.type === 'service_worker') {
791791
// Detaching releases the service worker's main script fetch throttle. Resuming first would race
792792
// with the browser-level session's Network.enable and lose the main script's Network.responseReceived.
793+
// See https://issues.chromium.org/issues/578112291.
794+
// TODO: remove this whole workaround block once the upstream issue is fixed.
793795
parentSession._sendMayFail('Target.detachFromTarget', { sessionId: event.sessionId });
794796
return;
795797
}

0 commit comments

Comments
 (0)