Home Reference Source
public class | source

FrameManager

Extends:

eventemitter3~EventEmitter → FrameManager

Constructor Summary

Public Constructor
public

constructor(client: Chrome | CRIConnection | CDPSession | Object, frameTree: Object, timeoutSettings: TimeoutSettings, networkManager: NetworkManager, page: Page)

Member Summary

Private Members
private
private
private
private
private
private
private
private

Method Summary

Public Methods
public
public
since chrome-remote-interface-extra
public

frame(frameId: string): Frame

public
public

async getFrameResourceContent(frameId: string, url: string): Promise<Buffer>

Returns content of the given resource.

since chrome-remote-interface-extra
public
since chrome-remote-interface-extra
public
public

async navigateFrame(frame: Frame, url: string, options: {referer?: string, timeout?: number, waitUntil?: string|Array<string>, transitionType?: string}=): Promise<Response|undefined>

public

page(): Page

public

toJSON(): {"mainFrame": *, "frames": *}

public

async waitForFrameNavigation(frame: Frame, options: {timeout?: number, waitUntil?: string|Array<string>}=): Promise<Response|undefined>

Private Methods
private
private

_handleFrameTree(frameTree: Object, first: boolean)

private

async _navigate(navigationParams: {transitionType: ?string, frameId: string, url: string, referrer: ?string}, endnObj: {ensureNewDocumentNavigation: boolean}): Promise<Error|undefined>

since chrome-remote-interface-extra
private
private
private
private
private
private
private
private
private
private

Public Constructors

public constructor(client: Chrome | CRIConnection | CDPSession | Object, frameTree: Object, timeoutSettings: TimeoutSettings, networkManager: NetworkManager, page: Page) source

Params:

NameTypeAttributeDescription
client Chrome | CRIConnection | CDPSession | Object
frameTree Object
  • nullable: false
timeoutSettings TimeoutSettings
  • nullable: false
networkManager NetworkManager
  • optional
page Page
  • optional

Private Members

private _client: Chrome | CRIConnection | CDPSession | Object source

private _contextIdToContext: Map<number, ExecutionContext> source

private _frames: Map<string, Frame> source

private _isolatedWorlds: Set<string> source

private _mainFrame: Frame source

private _networkManager: NetworkManager source

private _page: Page source

private _timeoutSettings: TimeoutSettings source

Public Methods

public async ensureSecondaryDOMWorld() source

public executionContextById(contextId: number): ExecutionContext since chrome-remote-interface-extra source

Params:

NameTypeAttributeDescription
contextId number

Return:

ExecutionContext (nullable: false)

public frame(frameId: string): Frame source

Params:

NameTypeAttributeDescription
frameId string
  • nullable: false

Return:

Frame (nullable: true)

public frames(): Array<Frame> source

Return:

Array<Frame> (nullable: false)

public async getFrameResourceContent(frameId: string, url: string): Promise<Buffer> since chrome-remote-interface-extra source

Returns content of the given resource. EXPERIMENTAL

Params:

NameTypeAttributeDescription
frameId string

Frame id to get resource for

url string

URL of the resource to get content for

Return:

Promise<Buffer>

Resource content

See:

public async getResourceTree(): Promise<FrameResourceTree> since chrome-remote-interface-extra source

public mainFrame(): Frame source

Return:

Frame (nullable: false)

public async navigateFrame(frame: Frame, url: string, options: {referer?: string, timeout?: number, waitUntil?: string|Array<string>, transitionType?: string}=): Promise<Response|undefined> source

Params:

NameTypeAttributeDescription
frame Frame
  • nullable: false
url string
options {referer?: string, timeout?: number, waitUntil?: string|Array<string>, transitionType?: string}=
  • nullable: false

public page(): Page source

Return:

Page (nullable: true)

public toJSON(): {"mainFrame": *, "frames": *} source

Return:

{"mainFrame": *, "frames": *}

public async waitForFrameNavigation(frame: Frame, options: {timeout?: number, waitUntil?: string|Array<string>}=): Promise<Response|undefined> source

Params:

NameTypeAttributeDescription
frame Frame
  • nullable: false
options {timeout?: number, waitUntil?: string|Array<string>}=
  • nullable: false

Private Methods

private async _ensureIsolatedWorld(name: string) source

Params:

NameTypeAttributeDescription
name string

private _handleFrameTree(frameTree: Object, first: boolean) source

Params:

NameTypeAttributeDescription
frameTree Object
  • nullable: false
first boolean
  • optional
  • default: false

private async _navigate(navigationParams: {transitionType: ?string, frameId: string, url: string, referrer: ?string}, endnObj: {ensureNewDocumentNavigation: boolean}): Promise<Error|undefined> since chrome-remote-interface-extra source

Params:

NameTypeAttributeDescription
navigationParams {transitionType: ?string, frameId: string, url: string, referrer: ?string}
endnObj {ensureNewDocumentNavigation: boolean}

private _onExecutionContextCreated(event: Object) source

Params:

NameTypeAttributeDescription
event Object
  • nullable: false

private _onExecutionContextDestroyed(event: Object) source

Params:

NameTypeAttributeDescription
event Object
  • nullable: false

private _onExecutionContextsCleared() source

private _onFrameAttached(event: Object) source

Params:

NameTypeAttributeDescription
event Object
  • nullable: false

private _onFrameDetached(event: Object) source

Params:

NameTypeAttributeDescription
event Object
  • nullable: false

private _onFrameNavigated(event: Object) source

Params:

NameTypeAttributeDescription
event Object
  • nullable: false

private _onFrameNavigatedWithinDocument(event: Object) source

Params:

NameTypeAttributeDescription
event Object
  • nullable: false

private _onFrameStoppedLoading(event: Object) source

Params:

NameTypeAttributeDescription
event Object
  • nullable: false

private _onLifecycleEvent(event: Object) source

Params:

NameTypeAttributeDescription
event Object
  • nullable: false

private _removeFramesRecursively(frame: Frame) source

Params:

NameTypeAttributeDescription
frame Frame
  • nullable: false