Skip to main content
Module

x/puppeteer_plus/mod.ts>ExecutionContext

Deno port of puppeteer base on latest TypeScript source.
Go to Latest
class ExecutionContext
Re-export
import { ExecutionContext } from "https://deno.land/x/puppeteer_plus@0.14.0/mod.ts";

This class represents a context for JavaScript execution. A [Page] might have many execution contexts:

  • each frame has "default" execution context that is always created after frame is attached to DOM. This context is returned by the Frame.executionContext method.
  • Extension's content scripts create additional execution contexts.

Besides pages, execution contexts can be found in workers.

Constructors

new
ExecutionContext(
client: CDPSession,
contextPayload: Protocol.Runtime.ExecutionContextDescription,
world?: DOMWorld,
)

Properties

_client: CDPSession
_contextId: number
_contextName: string
optional
_world: DOMWorld

Methods

_adoptBackendNodeId(backendNodeId?: Protocol.DOM.BackendNodeId): Promise<ElementHandle<Node>>
_adoptElementHandle<T extends ElementHandle<Node>>(elementHandle: T): Promise<T>
evaluate<Params extends unknown[], Func extends EvaluateFunc<Params> = EvaluateFunc<Params>>(pageFunction: Func | string, ...args: Params): Promise<Awaited<ReturnType<Func>>>
evaluateHandle<Params extends unknown[], Func extends EvaluateFunc<Params> = EvaluateFunc<Params>>(pageFunction: Func | string, ...args: Params): Promise<HandleFor<Awaited<ReturnType<Func>>>>
frame(): Frame | null
queryObjects<Prototype>(prototypeHandle: JSHandle<Prototype>): Promise<HandleFor<Prototype[]>>

This method iterates the JavaScript heap and finds all the objects with the given prototype.