Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
sadym-chromium committed Oct 11, 2024
1 parent 00039fd commit 5ad80ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/bidiMapper/modules/cdp/CdpTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ import type {PreloadScriptStorage} from '../script/PreloadScriptStorage.js';
import type {RealmStorage} from '../script/RealmStorage.js';
import type {EventManager} from '../session/EventManager.js';

// TODO: rename to CdpPageTarget.
export class CdpTarget {
readonly #id: Protocol.Target.TargetID;
readonly #cdpClient: CdpClient;
readonly #browserCdpClient: CdpClient;
readonly #parentCdpClient: CdpClient;
readonly #realmStorage: RealmStorage;
readonly #eventManager: EventManager;
Expand All @@ -61,6 +61,7 @@ export class CdpTarget {
static create(
targetId: Protocol.Target.TargetID,
cdpClient: CdpClient,
browserCdpClient: CdpClient,
parentCdpClient: CdpClient,
realmStorage: RealmStorage,
eventManager: EventManager,
Expand All @@ -73,6 +74,7 @@ export class CdpTarget {
const cdpTarget = new CdpTarget(
targetId,
cdpClient,
browserCdpClient,
parentCdpClient,
eventManager,
realmStorage,
Expand All @@ -97,6 +99,7 @@ export class CdpTarget {
constructor(
targetId: Protocol.Target.TargetID,
cdpClient: CdpClient,
browserCdpClient: CdpClient,
parentCdpClient: CdpClient,
eventManager: EventManager,
realmStorage: RealmStorage,
Expand All @@ -108,6 +111,7 @@ export class CdpTarget {
) {
this.#id = targetId;
this.#cdpClient = cdpClient;
this.#browserCdpClient = browserCdpClient;
this.#parentCdpClient = parentCdpClient;
this.#eventManager = eventManager;
this.#realmStorage = realmStorage;
Expand Down Expand Up @@ -135,6 +139,10 @@ export class CdpTarget {
return this.#parentCdpClient;
}

get browserCdpClient(): CdpClient {
return this.#browserCdpClient;
}

/** Needed for CDP escape path. */
get cdpSessionId(): Protocol.Target.SessionID {
// SAFETY we got the client by it's id for creating
Expand Down
3 changes: 3 additions & 0 deletions src/bidiMapper/modules/cdp/CdpTargetManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const cdpToBidiTargetTypes = {
} as const;

export class CdpTargetManager {
readonly #browserCdpClient: CdpClient;
readonly #cdpConnection: CdpConnection;
readonly #targetKeysToBeIgnoredByAutoAttach = new Set<string>();
readonly #selfTargetId: string;
Expand Down Expand Up @@ -72,6 +73,7 @@ export class CdpTargetManager {
logger?: LoggerFn
) {
this.#cdpConnection = cdpConnection;
this.#browserCdpClient = browserCdpClient;
this.#targetKeysToBeIgnoredByAutoAttach.add(selfTargetId);
this.#selfTargetId = selfTargetId;
this.#eventManager = eventManager;
Expand Down Expand Up @@ -315,6 +317,7 @@ export class CdpTargetManager {
const target = CdpTarget.create(
targetInfo.targetId,
targetCdpClient,
this.#browserCdpClient,
parentCdpClient,
this.#realmStorage,
this.#eventManager,
Expand Down

0 comments on commit 5ad80ff

Please sign in to comment.