Skip to content

Commit

Permalink
feat: add temp context into worker realm for Puppeteer
Browse files Browse the repository at this point in the history
  • Loading branch information
sadym-chromium committed Jan 31, 2024
1 parent 119dd4c commit a66c3fa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/bidiMapper/domains/script/DedicatedWorkerRealm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ export class DedicatedWorkerRealm extends Realm {
return 'dedicated-worker';
}

override get source(): Script.Source {
return {
realm: this.realmId,
// This is a hack to make Puppeteer able to track workers.
// TODO: remove after Puppeteer tracks workers by owners and use the base version.
context: this.associatedBrowsingContexts[0]?.id,
};
}

override get realmInfo(): Script.DedicatedWorkerRealmInfo {
return {
...this.baseInfo,
Expand Down

0 comments on commit a66c3fa

Please sign in to comment.