Electron 5.0.0
Electron 团队很高兴发布了 Electron 5.0.0.0! You can install it with npm via npm install electron@latest
or download the tarballs from our releases page. 这次发布包含升级、修复和新功能。 We can't wait to see what you build with them! Continue reading for details about this release, and please share any feedback you have!
What's New?
Much of Electron's functionality is provided by the core components of Chromium, Node.js, and V8. Electron keeps up-to-date with these projects to provide our users with new JavaScript features, performance improvements, and security fixes. Each of these packages has a major version bump in Electron 5:
- Chromium
73.0.3683.119
- Node.js
12.0.0
- V8
7.3.492.27
.
Electron 5 also includes improvements to Electron-specific APIs. A summary of the major changes is below; for the full list of changes, check out the Electron v5.0.0 release notes.
Promisification
Electron 5 continues Promisification initiative initiative to convert Electron's callback-based API to use Promises. These APIs were converted for Electron 5:
app.getFileIcon
contentTracing.getCategories
contentTracing.startRecording
contentTracing.stopRecording
debugger.sendCommand
- Cookies API
shell.openExternal
webContents.loadFile
webContents.loadURL
webContents.zoomLevel
webContents.zoomFactor
win.capturePage
System colors access for macOS
These functions were changed or added to systemPreferences
to access macOS systems' colors:
systemPreferences.getAccentColor
systemPreferences.getColor
systemPreferences.getSystemColor
Process memory information
The function process.getProcessMemoryInfo
has been added to get memory usage statistics about the current process.
Additional filtering for remote APIs
To improve security in the remote
API, new remote events have been added so that remote.getBuiltin
, remote.getCurrentWindow
, remote.getCurrentWebContents
and <webview>.getWebContents
can be filtered.
Multiple BrowserViews on BrowserWindow
BrowserWindow now supports managing multiple BrowserViews within the same BrowserWindow.
重大更改
Defaults for packaged apps
Packaged apps will now behave the same as the default app: a default application menu will be created unless the app has one and the window-all-closed
event will be automatically handled unless the app handles the event.
Mixed sandbox
Mixed sandbox mode is now enabled by default. Renderers launched with sandbox: true
will now be actually sandboxed, where previously they would only be sandboxed if mixed-sandbox mode was also enabled.
Security improvements
The default values of nodeIntegration
and webviewTag
are now false
to improve security.