cdpTarget.d.ts 1.3 KB

123456789101112131415161718192021222324252627282930
  1. import type { ICdpClient } from '../../../cdp/cdpClient.js';
  2. import type { RealmStorage } from '../script/realmStorage.js';
  3. import type { IEventManager } from '../events/EventManager.js';
  4. import type { CommonDataTypes } from '../../../protocol/protocol.js';
  5. import { Deferred } from '../../../utils/deferred.js';
  6. import type { ChannelProxy } from '../script/channelProxy.js';
  7. import type { PreloadScriptStorage } from './PreloadScriptStorage.js';
  8. export declare class CdpTarget {
  9. #private;
  10. static create(targetId: string, parentTargetId: string | null, cdpClient: ICdpClient, cdpSessionId: string, realmStorage: RealmStorage, eventManager: IEventManager, preloadScriptStorage: PreloadScriptStorage): CdpTarget;
  11. private constructor();
  12. /** Returns a promise that resolves when the target is unblocked. */
  13. get targetUnblocked(): Deferred<void>;
  14. get targetId(): string;
  15. get cdpClient(): ICdpClient;
  16. /**
  17. * Needed for CDP escape path.
  18. */
  19. get cdpSessionId(): string;
  20. /**
  21. * Enables the Network domain (creates NetworkProcessor on the target's cdp
  22. * client) if it is not enabled yet.
  23. */
  24. enableNetworkDomain(): Promise<void>;
  25. /**
  26. * All the ProxyChannels from all the preload scripts of the given
  27. * BrowsingContext.
  28. */
  29. getChannels(contextId: CommonDataTypes.BrowsingContext): ChannelProxy[];
  30. }