2.5.进程间通讯
进程之间的通讯方式
Electron使用IPC(interprocess communication)在进程之间进行通讯
安装Devtron插件
官网地址:devtron
# Install Devtron
$ npm install --save-dev devtron
// Run the following from the Console tab of your app's DevTools
require('devtron').install()
// You should now see a Devtron tab added to the DevTools
const { app, BrowserWindow} = require('electron')
app.on('ready',()=>{
require('devtron').install()
let mainWindow = new BrowserWindow({
width: 1600,
height: 1200,
webPreferences: {
nodeIntegration: true
}
})
mainWindow.loadFile('index.html')
mainWindow.webContents.openDevTools()
})
Last updated
Was this helpful?