docs: use electron/main & electron/renderer imports in fiddles (#39666)

This commit is contained in:
Milan Burda 2023-08-28 13:23:10 +02:00 committed by GitHub
parent d42a94ddde
commit f2f83a73fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 78 additions and 88 deletions

View file

@ -1,11 +1,5 @@
// All of the Node.js APIs are available in the preload process.
// It has the same sandbox as a Chrome extension.
const { contextBridge, ipcRenderer } = require('electron')
const { contextBridge, ipcRenderer } = require('electron/renderer')
// Set up context bridge between the renderer process and the main process
contextBridge.exposeInMainWorld(
'shell',
{
open: () => ipcRenderer.send('shell:open')
}
)
contextBridge.exposeInMainWorld('shell', {
open: () => ipcRenderer.send('shell:open')
})