Home Reference Source
public class | source

Frame

Static Method Summary

Static Public Methods
public static

fromCDPFrame(frameManager: FrameManager, cdpFrame: Object, parentFrame: Frame): Frame

since chrome-remote-interface-extra

Constructor Summary

Public Constructor
public

constructor(frameManager: FrameManager, client: Chrome | CRIConnection | CDPSession | Object, parentFrame: Frame, frameId: string)

Member Summary

Private Members
private
private
private
private
private
private
private
private
private
since chrome-remote-interface-extra
private
private
private
private
private
private
since chrome-remote-interface-extra
private
since chrome-remote-interface-extra
private

Method Summary

Public Methods
public
public
public

$$eval(selector: string, pageFunction: Function | string, args: ...*): Promise<Object|undefined>

public

$eval(selector: string, pageFunction: Function | string, args: ...*): Promise<Object|undefined>

public

$x(expression: string): Promise<Array<ElementHandle>>

public

addScriptTag(options: {url?: string, path?: string, content?: string, type?: string}): Promise<ElementHandle>

public

addStyleTag(options: {url?: string, path?: string, content?: string}): Promise<ElementHandle>

public
public

click(selector: string, options: {delay?: number, button?: "left"|"right"|"middle", clickCount?: number}=): *

public
public

evaluate(pageFunction: Function | string, args: ...*): Promise<*>

public

evaluateHandle(pageFunction: Function | string, args: ...*): Promise<JSHandle>

public
public

focus(selector: string): *

public
public
since chrome-remote-interface-extra
public

goto(url: string, options: {referer?: string, timeout?: number, waitUntil?: string|Array<string>}=): Promise<Response|undefined>

public

hover(selector: string): *

public

id(): string

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

Alias for $

public

Alias for $$

public

querySelectorAllEval(selector: string, pageFunction: Function | String, args: ...*): Promise<Object|undefined>

Alias for $$eval

public

querySelectorEval(selector: string, pageFunction: Function | String, args: ...*): Promise<Object|undefined>

Alias for $eval

public
since chrome-remote-interface-extra
public

select(selector: string, values: ...string): Promise<Array<string>>

public

setContent(html: string, options: {timeout?: number, waitUntil?: string|Array<string>}): *

public

tap(selector: string): *

public
public

toJSON(): {"id": *, "detached": *, "url": *, "loaderId": *, "parentId": *, "securityOrigin": *, "mimeType": *, "unreachableUrl": *, "childFrames": *}

public

type(selector: string, text: string, options: {delay: number|undefined}): *

public
public

url(): string

public

waitFor(selectorOrFunctionOrTimeout: string | number | Function, options: Object, args: ...*): Promise<JSHandle|Undefined>

public

waitForFunction(pageFunction: Function | string, options: {polling?: string|number, timeout?: number}, args: ...*): Promise<JSHandle>

public

waitForNavigation(options: {timeout?: number, waitUntil?: string|Array<string>}): Promise<Response>

public

async waitForSelector(selector: string, options: {visible?: boolean, hidden?: boolean, timeout?: number}=): Promise<ElementHandle|undefined>

public

async waitForXPath(xpath: string, options: {visible?: boolean, hidden?: boolean, timeout?: number}): Promise<ElementHandle|undefined>

public

Alias for $x

since chrome-remote-interface-extra
Private Methods
private
private

_navigated(framePayload: Object)

private
private

_onLifecycleEvent(loaderId: string, name: string)

private

Static Public Methods

public static fromCDPFrame(frameManager: FrameManager, cdpFrame: Object, parentFrame: Frame): Frame since chrome-remote-interface-extra source

Params:

NameTypeAttributeDescription
frameManager FrameManager
cdpFrame Object
parentFrame Frame
  • optional

Return:

Frame

Public Constructors

public constructor(frameManager: FrameManager, client: Chrome | CRIConnection | CDPSession | Object, parentFrame: Frame, frameId: string) source

Params:

NameTypeAttributeDescription
frameManager FrameManager
  • nullable: false
client Chrome | CRIConnection | CDPSession | Object
  • nullable: false
parentFrame Frame
  • nullable: true
frameId string

Private Members

private _childFrames: Set<Frame> source

private _client: Chrome | CRIConnection | CDPSession | Object source

private _detached: boolean source

private _frameManager: FrameManager source

private _id: string source

private _lifecycleEvents: Set<string> source

private _loaderId: string source

private _mainWorld: DOMWorld source

private _mimeType: string since chrome-remote-interface-extra source

private _name: string source

private _navigationURL: string source

private _parentFrame: Frame source

private _parentId: string source

private _secondaryWorld: DOMWorld source

private _securityOrigin: string since chrome-remote-interface-extra source

private _unreachableUrl: string since chrome-remote-interface-extra source

private _url: string source

Public Methods

public $(selector: string): Promise<ElementHandle|undefined> source

Params:

NameTypeAttributeDescription
selector string

public $$(selector: string): Promise<Array<ElementHandle>> source

Params:

NameTypeAttributeDescription
selector string

public $$eval(selector: string, pageFunction: Function | string, args: ...*): Promise<Object|undefined> source

Params:

NameTypeAttributeDescription
selector string
pageFunction Function | string
args ...*

public $eval(selector: string, pageFunction: Function | string, args: ...*): Promise<Object|undefined> source

Params:

NameTypeAttributeDescription
selector string
pageFunction Function | string
args ...*

public $x(expression: string): Promise<Array<ElementHandle>> source

Params:

NameTypeAttributeDescription
expression string

public addScriptTag(options: {url?: string, path?: string, content?: string, type?: string}): Promise<ElementHandle> source

Params:

NameTypeAttributeDescription
options {url?: string, path?: string, content?: string, type?: string}
  • nullable: false

public addStyleTag(options: {url?: string, path?: string, content?: string}): Promise<ElementHandle> source

Params:

NameTypeAttributeDescription
options {url?: string, path?: string, content?: string}
  • nullable: false

public childFrames(): Array<Frame> source

Return:

Array<Frame>

public click(selector: string, options: {delay?: number, button?: "left"|"right"|"middle", clickCount?: number}=): * source

Params:

NameTypeAttributeDescription
selector string
options {delay?: number, button?: "left"|"right"|"middle", clickCount?: number}=
  • nullable: false

Return:

*

public content(): Promise<String> source

Return:

Promise<String>

public evaluate(pageFunction: Function | string, args: ...*): Promise<*> source

Params:

NameTypeAttributeDescription
pageFunction Function | string
args ...*

Return:

Promise<*>

public evaluateHandle(pageFunction: Function | string, args: ...*): Promise<JSHandle> source

Params:

NameTypeAttributeDescription
pageFunction Function | string
args ...*

Return:

Promise<JSHandle>

public executionContext(): Promise<ExecutionContext> source

Return:

Promise<ExecutionContext> (nullable: true)

public focus(selector: string): * source

Params:

NameTypeAttributeDescription
selector string

Return:

*

public frameManager(): FrameManager source

Return:

FrameManager (nullable: false)

public getElementById(elemId: string): Promise<ElementHandle|undefined> since chrome-remote-interface-extra source

Params:

NameTypeAttributeDescription
elemId string

See:

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

Params:

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

public hover(selector: string): * source

Params:

NameTypeAttributeDescription
selector string

Return:

*

public id(): string source

Return:

string

public isDetached(): boolean source

Return:

boolean

public loaderId(): string source

Return:

string

public mimeType(): string since chrome-remote-interface-extra source

Return:

string (nullable: true)

public name(): string source

Return:

string

public parentFrame(): Frame source

Return:

Frame (nullable: true)

public parentFrameId(): string source

Return:

string (nullable: true)

public querySelector(selector: string): Promise<ElementHandle|undefined> source

Alias for $

Params:

NameTypeAttributeDescription
selector string

public querySelectorAll(selector: string): Promise<Array<ElementHandle>> source

Alias for $$

Params:

NameTypeAttributeDescription
selector string

public querySelectorAllEval(selector: string, pageFunction: Function | String, args: ...*): Promise<Object|undefined> source

Alias for $$eval

Params:

NameTypeAttributeDescription
selector string
pageFunction Function | String
args ...*

public querySelectorEval(selector: string, pageFunction: Function | String, args: ...*): Promise<Object|undefined> source

Alias for $eval

Params:

NameTypeAttributeDescription
selector string
pageFunction Function | String
args ...*

public securityOrigin(): string since chrome-remote-interface-extra source

Return:

string (nullable: true)

public select(selector: string, values: ...string): Promise<Array<string>> source

Params:

NameTypeAttributeDescription
selector string
values ...string

Return:

Promise<Array<string>>

public setContent(html: string, options: {timeout?: number, waitUntil?: string|Array<string>}): * source

Params:

NameTypeAttributeDescription
html string
options {timeout?: number, waitUntil?: string|Array<string>}
  • optional
  • default: {}
  • nullable: false

Return:

*

public tap(selector: string): * source

Params:

NameTypeAttributeDescription
selector string

Return:

*

public title(): Promise<string> source

Return:

Promise<string>

public toJSON(): {"id": *, "detached": *, "url": *, "loaderId": *, "parentId": *, "securityOrigin": *, "mimeType": *, "unreachableUrl": *, "childFrames": *} source

Return:

{"id": *, "detached": *, "url": *, "loaderId": *, "parentId": *, "securityOrigin": *, "mimeType": *, "unreachableUrl": *, "childFrames": *}

public type(selector: string, text: string, options: {delay: number|undefined}): * source

Params:

NameTypeAttributeDescription
selector string
text string
options {delay: number|undefined}
  • optional

Return:

*

public unreachableUrl(): string source

Return:

string (nullable: true)

public url(): string source

Return:

string

public waitFor(selectorOrFunctionOrTimeout: string | number | Function, options: Object, args: ...*): Promise<JSHandle|Undefined> source

Params:

NameTypeAttributeDescription
selectorOrFunctionOrTimeout string | number | Function
options Object
  • nullable: true
args ...*

Return:

Promise<JSHandle|Undefined>

public waitForFunction(pageFunction: Function | string, options: {polling?: string|number, timeout?: number}, args: ...*): Promise<JSHandle> source

Params:

NameTypeAttributeDescription
pageFunction Function | string
options {polling?: string|number, timeout?: number}
  • optional
  • default: {}
  • nullable: false
args ...*

Return:

Promise<JSHandle>

public waitForNavigation(options: {timeout?: number, waitUntil?: string|Array<string>}): Promise<Response> source

Params:

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

Return:

Promise<Response>

public async waitForSelector(selector: string, options: {visible?: boolean, hidden?: boolean, timeout?: number}=): Promise<ElementHandle|undefined> source

Params:

NameTypeAttributeDescription
selector string
options {visible?: boolean, hidden?: boolean, timeout?: number}=
  • nullable: false

public async waitForXPath(xpath: string, options: {visible?: boolean, hidden?: boolean, timeout?: number}): Promise<ElementHandle|undefined> source

Params:

NameTypeAttributeDescription
xpath string
options {visible?: boolean, hidden?: boolean, timeout?: number}
  • optional
  • nullable: false

public xpathQuery(expression: string): Promise<Array<ElementHandle>> since chrome-remote-interface-extra source

Alias for $x

Params:

NameTypeAttributeDescription
expression string

Private Methods

private _detach() source

private _navigated(framePayload: Object) source

Params:

NameTypeAttributeDescription
framePayload Object
  • nullable: false

private _navigatedWithinDocument(url: string) source

Params:

NameTypeAttributeDescription
url string

private _onLifecycleEvent(loaderId: string, name: string) source

Params:

NameTypeAttributeDescription
loaderId string
name string

private _onLoadingStopped() source