feat(page): emit the event after removing the Worker (#7080)

This commit is contained in:
Pallav Jha 2021-04-12 13:04:06 +05:30 committed by GitHub
parent 943477cc1e
commit e34a6d5318
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -507,8 +507,8 @@ export class Page extends EventEmitter {
client.on('Target.detachedFromTarget', (event) => {
const worker = this._workers.get(event.sessionId);
if (!worker) return;
this.emit(PageEmittedEvents.WorkerDestroyed, worker);
this._workers.delete(event.sessionId);
this.emit(PageEmittedEvents.WorkerDestroyed, worker);
});
this._frameManager.on(FrameManagerEmittedEvents.FrameAttached, (event) =>