Skip to content

ElectronWebContents.executeJavaScript method

ElectronWebContents › executeJavaScript

Unofficial

Evaluates code in the page.

Signature:

executeJavaScript(code: string, userGesture?: boolean | undefined): Promise<unknown>

Parameters:

Parameter Type Description
code string The JavaScript code to execute.
userGesture? boolean | undefined Whether the execution should be treated as a user gesture.

Returns: Promise<unknown>A promise resolving with the result of the executed code.