fix: specify the target filter in setDiscoverTargets (#8742)

To stay compatible with the next version of Chromium.
See https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-setDiscoverTargets
This commit is contained in:
Alex Rudenko 2022-08-04 13:46:53 +02:00 committed by GitHub
parent 26f6165008
commit 49193cbf1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,7 +101,12 @@ export class ChromeTargetManager extends EventEmitter implements TargetManager {
this.#connection.on('sessiondetached', this.#onSessionDetached); this.#connection.on('sessiondetached', this.#onSessionDetached);
this.#setupAttachmentListeners(this.#connection); this.#setupAttachmentListeners(this.#connection);
this.#connection.send('Target.setDiscoverTargets', {discover: true}); // TODO: remove `as any` once the protocol definitions are updated with the
// next Chromium roll.
this.#connection.send('Target.setDiscoverTargets', {
discover: true,
filter: [{type: 'tab', exclude: true}, {}],
} as any);
} }
async initialize(): Promise<void> { async initialize(): Promise<void> {