From 61599b064424e589c73dd04c34657ade3176dae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=89=E9=9E=8B=E6=B2=A1=E5=8F=B7?= <308487730@qq.com> Date: Fri, 26 Nov 2021 08:53:19 +0800 Subject: [PATCH] chore: add comment --- src/preload/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/preload/index.ts b/src/preload/index.ts index 85e4910..3ee8047 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -1,5 +1,5 @@ import fs from 'fs' -import { contextBridge, ipcRenderer } from 'electron' +import { contextBridge, ipcRenderer, IpcRenderer } from 'electron' import { domReady } from './utils' import { useLoading } from './loading' @@ -16,6 +16,7 @@ contextBridge.exposeInMainWorld('fs', fs) contextBridge.exposeInMainWorld('removeLoading', removeLoading) contextBridge.exposeInMainWorld('ipcRenderer', { ...ipcRenderer, + // `exposeInMainWorld` will not expose attribute and mothods from the prototype on(...args: Parameters) { return ipcRenderer.on(...args) }