addScriptToEvaluateOnNewDocument

Evaluates given script in every frame upon creation (before loading frame's scripts).


suspend fun addScriptToEvaluateOnNewDocument(source: String, worldName: String? = null, includeCommandLineAPI: Boolean? = null, runImmediately: Boolean? = null): Page.AddScriptToEvaluateOnNewDocumentReturn

Evaluates given script in every frame upon creation (before loading frame's scripts).

Parameters

source

No description

worldName

If specified, creates an isolated world with the given name and evaluates given script in it. This world name will be used as the ExecutionContextDescription::name when the corresponding event is emitted.

includeCommandLineAPI

Specifies whether command line API should be available to the script, defaults to false.

runImmediately

If true, runs the script immediately on existing execution contexts or worlds. Default: false.