docs: use electron/main & electron/renderer imports in fiddles (#39666)
This commit is contained in:
parent
d42a94ddde
commit
f2f83a73fc
70 changed files with 78 additions and 88 deletions
|
@ -1,5 +1,5 @@
|
|||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow, ipcMain, shell, dialog } = require('electron')
|
||||
const { app, BrowserWindow, ipcMain, shell, dialog } = require('electron/main')
|
||||
const path = require('node:path')
|
||||
|
||||
let mainWindow
|
||||
|
|
|
@ -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')
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue