Home Reference Source
public class | source

DOMWorld

Constructor Summary

Public Constructor
public

constructor(frameManager: FrameManager, frame: Frame, timeoutSettings: TimeoutSettings)

Member Summary

Private Members
private
private
private
private
private

_frame: *

private
private
private

Method Summary

Public Methods
public

async $(selector: string): Promise<ElementHandle>

public

async $$(selector: string): Promise<Array<ElementHandle>>

public

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

public

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

public

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

public

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

public

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

public

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

public
public

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

public

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

public
public

async focus(selector: string)

public
public
since chrome-remote-interface-extra
public

async hover(selector: string)

public
public
public

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

public

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

public

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

public

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

public

async tap(selector: string)

public

async title(): Promise<string>

public

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

public

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

public

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

public

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

public
Private Methods
private
private
private
private

async _waitForSelectorOrXPath(selectorOrXPath: string, isXPath: boolean, options: {visible?: boolean, hidden?: boolean, timeout?: number}=): Promise<ElementHandle>

Public Constructors

public constructor(frameManager: FrameManager, frame: Frame, timeoutSettings: TimeoutSettings) source

Params:

NameTypeAttributeDescription
frameManager FrameManager
  • nullable: false
frame Frame
  • nullable: false
timeoutSettings TimeoutSettings
  • nullable: false

Private Members

private _contextPromise: Promise<ExecutionContext> source

private _contextResolveCallback: * source

private _detached: boolean source

private _documentPromise: Promise<ElementHandle> source

private _frame: * source

private _frameManager: * source

private _timeoutSettings: * source

private _waitTasks: Set<WaitTask> source

Public Methods

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

Params:

NameTypeAttributeDescription
selector string

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

Params:

NameTypeAttributeDescription
selector string

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

Params:

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

Return:

Promise<Object>

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

Params:

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

Return:

Promise<Object>

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

Params:

NameTypeAttributeDescription
expression string

public async 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 async addStyleTag(options: {url: ?string, path: ?string, content: ?string}): Promise<ElementHandle> source

Params:

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

public async 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

public content(): Promise<String> source

Return:

Promise<String>

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

Params:

NameTypeAttributeDescription
pageFunction Function | string
args ...*

Return:

Promise<*>

public async 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 async focus(selector: string) source

Params:

NameTypeAttributeDescription
selector string

public frame(): Frame source

Return:

Frame (nullable: false)

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

Params:

NameTypeAttributeDescription
elemId string

See:

public async hover(selector: string) source

Params:

NameTypeAttributeDescription
selector string

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

Params:

NameTypeAttributeDescription
selector string

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

Params:

NameTypeAttributeDescription
selector string

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

Params:

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

Return:

Promise<Object>

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

Params:

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

Return:

Promise<Object>

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

Params:

NameTypeAttributeDescription
selector string
values ...string

Return:

Promise<Array<string>>

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

Params:

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

public async tap(selector: string) source

Params:

NameTypeAttributeDescription
selector string

public async title(): Promise<string> source

Return:

Promise<string>

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

Params:

NameTypeAttributeDescription
selector string
text string
options {delay: (number|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}=
  • nullable: false
args ...*

Return:

Promise<JSHandle>

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

Params:

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

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

Params:

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

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

Params:

NameTypeAttributeDescription
expression string

Private Methods

private _detach() source

private _document(): Promise<ElementHandle> source

private _setContext(context: ExecutionContext) source

Params:

NameTypeAttributeDescription
context ExecutionContext
  • nullable: true

private async _waitForSelectorOrXPath(selectorOrXPath: string, isXPath: boolean, options: {visible?: boolean, hidden?: boolean, timeout?: number}=): Promise<ElementHandle> source

Params:

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