Electron 14.0.0
Electron 14.0.0 вышел! It includes upgrades to Chromium 93
and V8 9.3
. We've added several API updates, bug fixes, and general improvements. Read below for more details!
Команда Electron рада объявить о выпуске Electron 14.0.0! You can install it with npm via npm install electron@latest
or download it from our releases website. Continue reading for details about this release and please share any feedback you have!
Notable Changes
Electron Release Cadence Change
Beginning in September 2021 with Electron 15, Electron will release a new major stable version every 8 weeks. You can read the full details here. Electron 15 will begin beta on September 1, 2021 and stable release will be on September 21, 2021. You can find Electron's public timeline here. Additionally, Electron will be changing supported versions from latest three versions to latest four versions until May 2022. See see our versioning document for more detailed information about versioning in Electron.
Stack Changes
- Chromium
93
- Node.js
14.17.0
- V8
9.3
Highlight Features
- Default Changed:
nativeWindowOpen
now defaults totrue
. (see docs) - Child windows no longer inherit BrowserWindow construction options from their parents. #28550
- Added new
session.storagePath
API to get the path on disk for session-specific data. #28665 - Added
process.contextId
used by@electron/remote
. #28007 - Added experimental cookie encryption support behind an Electron Fuse. #29492
See the 14.0.0 release notes for a full list of new features and changes.
Критические изменения
Below are breaking changes introduced in Electron 14. More information about these and future changes can be found on the Planned Breaking Changes page.
Удален: app.allowRendererProcessReuse
The app.allowRendererProcessReuse
property has been removed as part of our plan to more closely align with Chromium's process model for security, performance and maintainability.
Для подробностей см. #18397.
Removed: Browser Window Affinity
The affinity
option when constructing a new BrowserWindow
has been removed as part of our plan to more closely align with Chromium's process model for security, performance and maintainability.
Для подробностей см. #18397.
Изменения в API: window.open()
The optional parameter frameName
no longer sets the title of the window. This behavior now follows the specification described by the native documentation for the windowName
parameter.
If you were using this parameter to set the title of a window, you can instead use the win.setTitle(title)
method.
Удален: worldSafeExecuteJavaScript
worldSafeExecuteJavaScript
has been removed with no alternative. Please ensure your code works with this property enabled. It has been enabled by default since Electron 12.
На вас повлияет это изменение, если вы используете либо webFrame.executeJavaScript
или webFrame.executeJavaScriptInIsolatedWorld
. Вам нужно будет убедиться, ч то значения, возвращаемые одним из этих методов, поддерживаются Context Bridge API, поскольку эти методы используют одинаковую семантику значения.
Default Changed: nativeWindowOpen
defaults to true
Prior to Electron 14, window.open
was by default shimmed to use BrowserWindowProxy
. This meant that window.open('about:blank')
did not work to open synchronously scriptable child windows, among other incompatibilities. nativeWindowOpen
is no longer experimental, and is now the default.
См. документацию по window.open в Electron для более подробной информации.
Removed: BrowserWindowConstructorOptions inheriting from parent windows
Prior to Electron 14, windows opened with window.open
would inherit BrowserWindow constructor options such as transparent
and resizable
from their parent window. Beginning with Electron 14, this behavior has been removed and windows will not inherit any BrowserWindow constructor options from their parents.
Instead, explicitly set options for the new window with setWindowOpenHandler
:
webContents.setWindowOpenHandler((details) => {
return {
action: 'allow',
overrideBrowserWindowOptions: {
// ...
},
};
});
Удален: additionalFeatures
The deprecated additionalFeatures
property in the new-window
and did-create-window
events of WebContents has been removed. Since new-window
uses positional arguments, the argument is still present, but will always be the empty array []
. (Note: the new-window
event itself is already deprecated and has been replaced by setWindowOpenHandler
.) Bare keys in window features will now present as keys with the value true
in the options object.
// Removed in Electron 14
// Triggered by window.open('...', '', 'my-key')
webContents.on('did-create-window', (window, details) => {
if (details.additionalFeatures.includes('my-key')) {
// ...
}
});
// Replace with
webContents.on('did-create-window', (window, details) => {
if (details.options['my-key']) {
// ...
}
});
Removed: remote
module
Deprecated in Electron 12, the remote
module has now been removed from Electron itself and extracted into a separate package, @electron/remote
. The @electron/remote
module bridges JavaScript objects from the main process to the renderer process. This lets you access main-process-only objects as if they were available in the renderer process. This is a direct replacement for the remote
module. See the module's readme for migration instructions and reference.
Изменения API
- Added
BrowserWindow.isFocusable()
method to determine whether a window is focusable. #28642 - Added
WebFrameMain.visibilityState
instance property. #28706 - Added
disposition
,referrer
andpostBody
to the details object passed to the window open handler registered withsetWindowOpenHandler
. #28518 - Added
process.contextId
used by@electron/remote
. #28007 - Added experimental cookie encryption support behind an Electron Fuse. #29492
- Added missing
resourceType
conversions forwebRequest
listener details:font
,ping
,cspReport
,media
,webSocket
. #30050 - Added new
session.storagePath
API to get the path on disk for session-specific data. #28665 - Added support for Windows Control Overlay on macOS. #29986
- Added support for directing Chromium logging to a file with
--log-file=.../path/to/file.log
. Also, it's now possible to enable logging from JavaScript by appending command-line switches during the first JS tick. #29963 - Added support for the des-ede3 cipher in node crypto. #27897
- Added a
ContextBridgeMutability
feature that allows context bridge objects to be mutated. #27348