Electron 35.0.0
Electron 35.0.0 已发布!它包括对 Chromium 134.0.6998.44、V8 13.5 和 Node 22.14.0 的升级。
🌐 Electron 35.0.0 has been released! It includes upgrades to Chromium 134.0.6998.44, V8 13.5, and Node 22.14.0.
Electron 团队很高兴地宣布发布 Electron 35.0.0!你可以通过 npm 使用 npm install electron@latest 安装,或从我们的发布网站下载。请继续阅读以了解此次发布的详细信息。
🌐 The Electron team is excited to announce the release of Electron 35.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.
如果你有任何反馈,请通过 Bluesky 或 Mastodon 与我们分享,或者加入我们的社区 Discord!可以在 Electron 的 问题追踪器 报告漏洞和功能请求。
🌐 If you have any feedback, please share it with us on Bluesky or Mastodon, or join our community Discord! Bugs and feature requests can be reported in Electron's issue tracker.
显著变化
🌐 Notable Changes
Service Worker 预加载脚本,用于改进扩展支持
🌐 Service Worker Preload Scripts for Improved Extensions Support
最初由 @samuelmaddock 在 RFC #8 中提出,Electron 35 增加了向 服务工作者 附加预加载脚本的能力。随着 Chrome 的 Manifest V3 扩展将大量工作通过 扩展服务工作者 路由,这一功能填补了 Electron 对现代 Chrome 扩展支持的空白。
🌐 Originally proposed in RFC #8 by @samuelmaddock, Electron 35 adds the ability to attach a preload script to Service Workers. With Chrome's Manifest V3 Extensions routing a lot of work through extension service workers, this feature fills in a gap in Electron's support for modern Chrome extensions.
在会话级别以编程方式注册预加载脚本时,现在可以使用 ses.registerPreloadScript(script) API 将其专门应用于服务工作线程上下文。
🌐 When registering a preload script programmatically at the Session level, you can now specifically apply it to Service Worker contexts with the ses.registerPreloadScript(script) API.
// Add our preload realm script to the session.
session.defaultSession.registerPreloadScript({
// Our script should only run in service worker preload realms.
type: 'service-worker',
// The absolute path to the script.
script: path.join(__dirname, 'extension-sw-preload.js'),
});
此外,现在可以通过 ServiceWorkerMain.ipc 类在 Service Workers 与其附加的预加载脚本之间进行 IPC。预加载脚本仍将使用 ipcRenderer 模块与其 Service Worker 通信。更多详细信息请参阅原始 RFC。
🌐 Furthermore, IPC is now available between Service Workers and their attached preload scripts via the ServiceWorkerMain.ipc class. The preload script will still use the ipcRenderer module to communicate with its Service Worker. See the original RFC for more details.
此功能之前有许多其他更改为其奠定了基础:
🌐 This feature was preceded by many other changes that laid the groundwork for it:
