Skip to content

ElectronWebContents.executeJavaScriptInIsolatedWorld method

ElectronWebContents › executeJavaScriptInIsolatedWorld

Unofficial

Works like executeJavaScript but evaluates scripts in an isolated context.

Signature:

executeJavaScriptInIsolatedWorld(worldId: number, scripts: ElectronWebSource[], userGesture?: boolean | undefined): Promise<unknown>

Parameters:

Parameter Type Description
worldId number The id of the isolated world.
scripts ElectronWebSource[] The scripts to evaluate.
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.