puppeteer/website/versioned_docs/version-15.3.0/api/puppeteer.executioncontext.md
release-please[bot] 01c76b7eb1
chore(main): release 15.3.0 (#8606)
* chore(main): release 15.3.0

* chore: generate versioned docs

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2022-07-01 17:02:54 +02:00

2.1 KiB

sidebar_label
ExecutionContext

ExecutionContext class

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.

Signature:

export declare class ExecutionContext

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ExecutionContext class.

Methods

Method Modifiers Description
evaluate(pageFunction, args)
evaluateHandle(pageFunction, args)
frame()
queryObjects(prototypeHandle) This method iterates the JavaScript heap and finds all the objects with the given prototype.