chore: disable page.pause() when JS debugger is attached (#11926)

This commit is contained in:
Pavel Feldman 2022-02-07 19:21:58 -08:00 committed by GitHub
parent 7912c515a3
commit dbd124d84b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -644,7 +644,10 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
}
async pause() {
await this.context()._channel.pause();
if (!!require('inspector').url())
debugger; // eslint-disable-line no-debugger
else
await this.context()._channel.pause();
}
async pdf(options: PDFOptions = {}): Promise<Buffer> {

View file

@ -179,7 +179,7 @@ export class BrowserContextDispatcher extends Dispatcher<BrowserContext, channel
}
async pause(params: channels.BrowserContextPauseParams, metadata: CallMetadata) {
// Inspector controller will take care of this.
// Debugger will take care of this.
}
async newCDPSession(params: channels.BrowserContextNewCDPSessionParams): Promise<channels.BrowserContextNewCDPSessionResult> {