|
@@ -1,5 +1,6 @@
|
|
|
import { webFrame, WebFrame } from 'electron'
|
|
|
import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal'
|
|
|
+import * as ipcRendererUtils from '@electron/internal/renderer/ipc-renderer-internal-utils'
|
|
|
import * as errorUtils from '@electron/internal/common/error-utils'
|
|
|
|
|
|
// All keys of WebFrame that extend Function
|
|
@@ -10,13 +11,13 @@ type WebFrameMethod = {
|
|
|
|
|
|
export const webFrameInit = () => {
|
|
|
// Call webFrame method
|
|
|
- ipcRendererInternal.on('ELECTRON_INTERNAL_RENDERER_WEB_FRAME_METHOD', (
|
|
|
- _event, method: keyof WebFrameMethod, args: any[]
|
|
|
+ ipcRendererUtils.handle('ELECTRON_INTERNAL_RENDERER_WEB_FRAME_METHOD', (
|
|
|
+ event, method: keyof WebFrameMethod, ...args: any[]
|
|
|
) => {
|
|
|
// The TypeScript compiler cannot handle the sheer number of
|
|
|
// call signatures here and simply gives up. Incorrect invocations
|
|
|
// will be caught by "keyof WebFrameMethod" though.
|
|
|
- (webFrame[method] as any)(...args)
|
|
|
+ return (webFrame[method] as any)(...args)
|
|
|
})
|
|
|
|
|
|
ipcRendererInternal.on('ELECTRON_INTERNAL_RENDERER_ASYNC_WEB_FRAME_METHOD', (
|