Options
All
  • Public
  • Public/Protected
  • All
Menu

The Worker class represents a WebWorker. The events workercreated and workerdestroyed are emitted on the page object to signal the worker lifecycle.

Hierarchy

Index

Methods

evaluate

  • Evaluates a function in the browser context. If the function, passed to the frame.evaluate, returns a Promise, then frame.evaluate would wait for the promise to resolve and return its value. If the function passed into frame.evaluate returns a non-Serializable value, then frame.evaluate resolves to undefined.

    Type parameters

    Parameters

    Returns Promise<EvaluateFnReturnType<T> extends PromiseLike<U> ? U : EvaluateFnReturnType<T>>

evaluateHandle

  • evaluateHandle<HandlerType>(pageFunction: string | ((arg1: any, ...args: any[]) => any), ...args: SerializableOrJSHandle[]): Promise<HandlerType>
  • The only difference between evaluate and evaluateHandle is that evaluateHandle returns in-page object (JSHandle). If the function, passed to the evaluateHandle, returns a Promise, then evaluateHandle would wait for the promise to resolve and return its value. The TypeScript definitions assume that evaluateHandle returns a JSHandle, but if you know it's going to return an ElementHandle, pass it as the generic argument:

    Type parameters

    Parameters

    • pageFunction: string | ((arg1: any, ...args: any[]) => any)

      a function that is run within the page

    • Rest ...args: SerializableOrJSHandle[]

      arguments to be passed to the pageFunction

    Returns Promise<HandlerType>

executionContext

  • Returns Promise<ExecutionContext>

url

  • url(): string
  • Returns string

Generated using TypeDoc