mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: make sure discovery happens before auto-attach (#11100)
This commit is contained in:
parent
b1eee926cc
commit
9ce204e27e
@ -127,14 +127,6 @@ export class ChromeTargetManager
|
|||||||
this.#onSessionDetached
|
this.#onSessionDetached
|
||||||
);
|
);
|
||||||
this.#setupAttachmentListeners(this.#connection);
|
this.#setupAttachmentListeners(this.#connection);
|
||||||
|
|
||||||
this.#connection
|
|
||||||
.send('Target.setDiscoverTargets', {
|
|
||||||
discover: true,
|
|
||||||
filter: this.#discoveryFilter,
|
|
||||||
})
|
|
||||||
.then(this.#storeExistingTargetsForInit)
|
|
||||||
.catch(debugError);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#storeExistingTargetsForInit = () => {
|
#storeExistingTargetsForInit = () => {
|
||||||
@ -163,6 +155,13 @@ export class ChromeTargetManager
|
|||||||
};
|
};
|
||||||
|
|
||||||
async initialize(): Promise<void> {
|
async initialize(): Promise<void> {
|
||||||
|
await this.#connection.send('Target.setDiscoverTargets', {
|
||||||
|
discover: true,
|
||||||
|
filter: this.#discoveryFilter,
|
||||||
|
});
|
||||||
|
|
||||||
|
this.#storeExistingTargetsForInit();
|
||||||
|
|
||||||
await this.#connection.send('Target.setAutoAttach', {
|
await this.#connection.send('Target.setAutoAttach', {
|
||||||
waitForDebuggerOnStart: true,
|
waitForDebuggerOnStart: true,
|
||||||
flatten: true,
|
flatten: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user