2cfcab8a74
This PR updates `example/with-electron`: - Updates electron to version [12 (latest stable)](https://www.electronjs.org/releases/stable#12.0.2) - Introduces the new `contextBridge` to increase security ([docs](https://www.electronjs.org/docs/api/context-bridge)) ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. ## Documentation / Examples - [x] Make sure the linting passes
9 lines
304 B
JavaScript
9 lines
304 B
JavaScript
const { ipcRenderer, contextBridge } = require('electron')
|
|
|
|
contextBridge.exposeInMainWorld('electron', {
|
|
message: {
|
|
send: (payload) => ipcRenderer.send('message', payload),
|
|
on: (handler) => ipcRenderer.on('message', handler),
|
|
off: (handler) => ipcRenderer.off('message', handler),
|
|
},
|
|
})
|