Skip to content

Commit

Permalink
fix(electron): fix can eval code in main process, fixed #2362
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <tukon479@gmail.com>
  • Loading branch information
Innei committed Dec 30, 2024
1 parent ec7105c commit 026b207
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shared/src/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>(
Expand Down

0 comments on commit 026b207

Please sign in to comment.