Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/pptr/mod.ts>DOMWorld

Headless Chrome Deno API
Latest
class DOMWorld
Re-export
import { DOMWorld } from "https://deno.land/x/pptr@1.2.0/mod.ts";

Constructors

new
DOMWorld(
frameManager: FrameManager,
frame: Frame,
timeoutSettings: TimeoutSettings,
)

Properties

private
_contextPromise: Promise<ExecutionContext> | null
private
_contextResolveCallback: ((x: ExecutionContext) => void) | null
private
_ctxBindings: Set<string>
private
_detached: boolean
private
_documentPromise: Promise<ElementHandle> | null
private
_frame: Frame
private
_frameManager: FrameManager
private
_settingUpBinding: Promise<void> | null
private
_timeoutSettings: TimeoutSettings
_boundFunctions: Map<string, Function>
_waitTasks: Set<WaitTask>

Methods

_detach(): void
_hasContext(): boolean
_setContext(context?: ExecutionContext): Promise<void>
$(selector: string): Promise<ElementHandle | null>
$$(selector: string): Promise<ElementHandle[]>
$$eval<ReturnType>(
selector: string,
pageFunction: (elements: Element[], ...args: unknown[]) => ReturnType | Promise<ReturnType>,
): Promise<WrapElementHandle<ReturnType>>
$eval<ReturnType>(
selector: string,
pageFunction: (element: Element, ...args: unknown[]) => ReturnType | Promise<ReturnType>,
): Promise<WrapElementHandle<ReturnType>>
$x(expression: string): Promise<ElementHandle[]>
addBindingToContext(context: ExecutionContext, name: string): Promise<void>
addScriptTag(options: { url?: string; path?: string; content?: string; type?: string; }): Promise<ElementHandle>

Adds a script tag into the current context.

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

Adds a style tag into the current context.

click(selector: string, options: { delay?: number; button?: MouseButton; clickCount?: number; }): Promise<void>
content(): Promise<string>
evaluate<T extends EvaluateFn>(pageFunction: T, ...args: SerializableOrJSHandle[]): Promise<UnwrapPromiseLike<EvaluateFnReturnType<T>>>
evaluateHandle<HandlerType extends JSHandle = JSHandle>(pageFunction: EvaluateHandleFn, ...args: SerializableOrJSHandle[]): Promise<HandlerType>
focus(selector: string): Promise<void>
hover(selector: string): Promise<void>
select(selector: string, ...values: string[]): Promise<string[]>
setContent(html: string, options?: { timeout?: number; waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[]; }): Promise<void>
tap(selector: string): Promise<void>
title(): Promise<string>
type(
selector: string,
text: string,
options?: { delay: number; },
): Promise<void>
waitForFunction(
pageFunction: Function | string,
options?: { polling?: string | number; timeout?: number; },
): Promise<JSHandle>
waitForSelector(selector: string, options: WaitForSelectorOptions): Promise<ElementHandle | null>
waitForSelectorInPage(
queryOne: Function,
selector: string,
binding?: PageBinding,
): Promise<ElementHandle | null>
waitForXPath(xpath: string, options: WaitForSelectorOptions): Promise<ElementHandle | null>

Static Properties

private
bindingIdentifier: (name: string, contextId: number) => unknown