Electron 12.0.0
Electron 12.0.0 已发布! It includes upgrades to Chromium 89
, V8 8.9
and Node.js 14.16
. We've added changes to the remote module, new defaults for contextIsolation, a new webFrameMain API, and general improvements. 请阅读下文了解更多详情!
Electron 团队很高兴发布了 Electron 12.0.0.0! 您可以通过 npm 安装electron@later
或者从我们的 发布网站 下载它。 Continue reading for details about this release, and please share any feedback you have!
重要变化
架构(Stack)更新
- Chromium
89
- Node.js
14.16
- V8
8.9
Highlight Features
- The ContextBridge
exposeInMainWorld
method can now expose non-object APIs. #26834 - 将Nodejs版本从12更新至14 #23249
- Added a new
webFrameMain
API for accessing sub-frames of aWebContents
instance from the main process. #25464 - 将
contextIsolation
和worldSafeExecuteJavaScript
的默认值更改为true
。 #27949 #27502
有关新功能和变更的完整列表,请参阅 12.0.0 发布通知 。
重大更改
- 弃用
remote
模块。 它被@electron/remote
代替。 #25293- If you are currently using the
remote
module, we've written a guide to migrating to@electron/remote
here.
- If you are currently using the
- 将
contextIsolation
的默认值更改为true
。 #27949 - 将
worldSafeExecuteJavaScript
的默认值更改为true
。 #27502 - 将
crashReporter.start({ compress })
的默认值从false
更改为true
。 #25288 - 移除Flash支持:Chromium移除了Flash的支持,Electron 12也将移除它。 查看 Chromium's Flash Roadmap 获取详细信息
- Required SSE3 for Chrome on x86: Chromium has removed support for older x86 CPUs that do not meet a minimum of SSE3 (Streaming SIMD Extensions 3) support. This support was also removed in Electron 12.
有关这些和未来变化的更多信息可在 计划的破坏性变化 页面找到。
API 更改
- Added
webFrameMain
API: ThewebFrameMain
module can be used to look up frames across existingWebContents
instances. This is the main process equivalent of the existing webFrame API. More information about this new API can be found here, and in our documentation. app
API changes:BrowserWindow
API changes:- 添加
BrowserWindow.isTabletMode()
API。 #25209 - Added
resized
(Windows/macOS) andmoved
(Windows) events toBrowserWindow
. #26216 - Added new
system-context-menu
event to allow preventing and overriding the system context menu. #25795 - Added
win.setTopBrowserView()
so thatBrowserView
s can be raised. #27713 - Added
webPreferences.preferredSizeMode
to allow sizing views according to their document's minimum size. #25874
- 添加
contextBridge
API changes:- Allowed ContextBridge
exposeInMainWorld
method to expose non-object APIs. #26834
- Allowed ContextBridge
display
API changes:- Added
displayFrequency
property to theDisplay
object to allow getting information about the refresh rate on Windows. #26472
- Added
extensions
API changes:- Added support for some
chrome.management
APIs. #25098
- Added support for some
MenuItem
API changes:- Added support for showing macOS share menu. #25629
net
API changes:powerMonitor
API changes:session
API changes:- Added
allowFileAccess
option toses.loadExtension()
API. #27702 - Added
display-capture
API forsession.setPermissionRequestHandler
. #27696 - Added a
disabledCipherSuites
option tosession.setSSLConfig
. #25818 - Added
extension-loaded
,extension-unloaded
, andextension-ready
events tosession
. #25385 - Added
session.setSSLConfig()
to allow configuring SSL. #25461 - Added support for explicitly specifying
direct
,auto_detect
orsystem
modes insession.setProxy()
. #24937 - Added Serial API support. #25237
- Added APIs to enable/disable spell checker. #26276
- Added
shell
API changes:- Added a new asynchronous
shell.trashItem()
API, replacing the synchronousshell.moveItemToTrash()
. #25114
- Added a new asynchronous
webContents
API changes:- Added a small console hint to console to help debug renderer crashes. #25317
- Added
frame
andwebContents
properties to the details object in webRequest handlers. #27334 - Added
webContents.forcefullyCrashRenderer()
to forcefully terminate a renderer process to assist with recovering a hung renderer. #25580 - Added
setWindowOpenHandler
API for renderer-created child windows, and deprecatenew-window
event. #24517
webFrame
API changes:- Added spellcheck API to renderer. #25060
Removed/Deprecated Changes
The following APIs have been removed or are now deprecated:
- 弃用
remote
模块。 它被@electron/remote
代替。 #25293 - Removed deprecated
crashReporter
APIs. #26709 - Removed links to the Electron website from the default 'Help' menu in packaged apps. #25831
终止对 9.x.y 的支持
根据项目的支持政策,Electron 9.x.y 已经达到了支持的终点。 我们鼓励开发者将应用程序升级到更新的 Electron 版本。
接下来
在短期内,您可以期待团队继续专注于跟上构成 Electron 的主要组件的开发,包括 Chromium、Node 和 V8。 尽管我们谨慎地避免对发布日期做出承诺,但我们的计划是大约每季度发布一次 Electron 的新主要版本以及这些组件的新版本。 暂定 13.0.0 时间表 展示了 Electron 13.0 开发生命周期中的关键日期。 Also, see our versioning document for more detailed information about versioning in Electron.
For information on planned breaking changes in upcoming versions of Electron, see our Planned Breaking Changes doc.