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 679120c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/bidiMapper/domains/script/DedicatedWorkerRealm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,16 @@ export class DedicatedWorkerRealm extends Realm {
}

override get realmInfo(): Script.DedicatedWorkerRealmInfo {
return {
const realmInfo: Script.DedicatedWorkerRealmInfo = {
...this.baseInfo,
type: this.realmType,
owners: [this.#ownerRealm.realmId],
};
return {
...realmInfo,
// This is a hack to make Puppeteer able to track workers.
// TODO: remove after Puppeteer tracks workers by owners.
context: this.associatedBrowsingContexts[0]?.id,
} as Script.DedicatedWorkerRealmInfo;
}
}

0 comments on commit 679120c

Please sign in to comment.