fix(electron): fix can eval code in main process, fixed #2362

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei 2024-12-30 13:48:42 +08:00
parent ec7105c960
commit 026b2075bc
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
1 changed files with 1 additions and 1 deletions

View File

@ -125,7 +125,7 @@ type Fn<T> = {
(T[K] extends object ? { [P in keyof T[K]]: AddPromise<T[K][P]> } : never)
}
export function callWindowExpose<T extends RenderGlobalContext>(window: BrowserWindow) {
return createProxy(window.webContents.executeJavaScript) as Fn<T>
return createProxy((code) => window.webContents.executeJavaScript(code)) as Fn<T>
}
export function callWebviewExpose<T extends RenderGlobalContext>(