mirror of
https://github.com/electron/electron.git
synced 2026-01-08 23:18:06 -05:00
docs: mention contextIsolation in ipc-main example (#29918)
This commit is contained in:
@@ -40,6 +40,8 @@ ipcMain.on('synchronous-message', (event, arg) => {
|
||||
|
||||
```javascript
|
||||
// In renderer process (web page).
|
||||
// NB. Electron APIs are only accessible from preload, unless contextIsolation is disabled.
|
||||
// See https://www.electronjs.org/docs/tutorial/process-model#preload-scripts for more details.
|
||||
const { ipcRenderer } = require('electron')
|
||||
console.log(ipcRenderer.sendSync('synchronous-message', 'ping')) // prints "pong"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user