klarna / electron-redux

Use redux in the main and browser processes in electron
MIT License
745 stars 95 forks source link

support contextBridge api #235

Closed musou1500 closed 3 years ago

musou1500 commented 4 years ago

Is your feature request related to a problem? Please describe.

we need to use preload script or nodeIntegration option to use electron-redux. I think preload script is ideal for security perspective. I often load application hosted on local server while developing(I believe it is common usecase). but application can not be loaded as preload script in this way. It requires us to additional branch.

Describe the solution you'd like

I propose to support contextBridge api. I am assuming expose simple api that communicate with main process using ipcRenderer api through contextBridge. in this way, application on renderer process can use electron-redux regardless it is loaded through local server or preload script.

Nantris commented 3 years ago

This is really crucial for security. @matmalkowski are there any plans for this?

matmalkowski commented 3 years ago

@musou1500 @Slapbox I think we could support contextBridge in v2, since right now communication is all done with ipc (ipcRenderer & ipcMain only)

Nantris commented 3 years ago

@matmalkowski any update on a timeline for v2? Do you think this might be addressed once v2 is out? We're really looking forward to its release!

matmalkowski commented 3 years ago

Yeah, I actually got an issue already created for that: #289 , just slightly different naming. Right now I'm quite busy with other stuff, so it is hard to tell when this could be incorporated into v2, but the general plan is to include that in the version 2, finish up the documentation and create a stable release afterwards. If you are interested, you may take a look at the issue, it links to possible implementation in the fork of that project, and raise a PR to v2 if you have some spare time to implement it

matmalkowski commented 3 years ago

Closing as duplicate of #289, we can continue all discussions in that ticket 👍🏻