PlatformScriptEngine

Handles JavaScript evaluation and document-start init script injection on the platform backend.

Constructors

Link copied to clipboard
constructor(session: PageSession, config: BrowserConfig)

Types

Link copied to clipboard
object Companion

Output-capping constants shared with tests.

Functions

Link copied to clipboard
suspend fun addInitScript(script: String, allowedOrigins: Set<String>)

Installs a script that runs before any page script runs on current and future documents.

Link copied to clipboard
suspend fun evaluate(expression: String, timeoutMillis: Long = 0): String?

Evaluates a JavaScript expression in the page context.