You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since 2020 the security of the electron apps require recommend a preload function. To use this lib with preload it could export the preload function.
I am able to make the pull request, it is just a questions if I should?
Export somehow this function
contextBridge.exposeInMainWorld('api',{send: (channel: string,requestId: string,action: string,payload: any): void=>{constvalidChannel=['asyncRequest'];if(validChannel.includes(channel)){ipcRenderer.send(channel,requestId,action,payload);}},on: (channel: string,callback: Function): void=>{constvalidChannel=['asyncResponseNotify','asyncResponse','errorResponse',]if(validChannel.includes(channel)){// Strip event but pass an empty object to the callbackipcRenderer.on(channel,(_event, ...args)=>callback({}, ...args));}}});
Can you post a link to some docs? I don't know about this update.
In general, I'm always looking for enhancements to this project. But I feel that introducing this API will break existing projects, so we'll have to do a major release.
Since 2020 the security of the electron apps
requirerecommend a preload function. To use this lib with preload it could export the preload function.I am able to make the pull request, it is just a questions if I should?
Export somehow this function
So the user can do:
The text was updated successfully, but these errors were encountered: