Electron 7.0.0 穩定版正式發布了,Electron 是 GitHub 開發的跨平臺桌面應用開發工具,支持使用 Web 技術開發桌面應用,其基於 C++ 開發,GUI 核心來自於 Chromium,而 JavaScript 引擎使用 V8。
此片更新內容如下:
Notable Changes
Electron 的核心組件是 Chromium、Node.js 與 V8,按照國際慣例它一般都會與這些項目保持同步更新,以提供最新的 JavaScript 特性、性能改進和安全修復。在此版本中這三者分別升級內容如下:
Chromium 78.0.3905.1
Node.js 12.8.1
Node 12.8.1 更新內容
Node 12.8
Node 12.7
Node 12.6
Node 12.5
V8 7.8
增加了 Windows on ARM(64位) 版本
為異步請求/響應的 IPC 添加了 ipcRenderer.Invoke() 和 ipcMain.Handle()
添加了 nativeTheme API 來讀取和響應作業系統主題和顏色方案的變化
切換到新的 TypeScript Definitions 生成器,生成更加精確的定義
Breaking Changes
刪除部分 API:
Tray.setHighlightMode() (macOS)
app.enableMixedSandbox()
app.getApplicationMenu()
app.setApplicationMenu()
powerMonitor.querySystemIdleState()
powerMonitor.querySystemIdleTime()
webFrame.setIsolatedWorldContentSecurityPolicy()
webFrame.setIsolatedWorldHumanReadableName()
webFrame.setIsolatedWorldSecurityOrigin()
Session.clearAuthCache() 不再過濾已清除的緩存條目
MacOS 上的本機接口(菜單、對話框等)現在自動匹配用戶機器上的暗模式設置
更新 electron 模塊以使用 @Electronics/get,支持 Node 8
Electron.asar 文件不再存在
New Features
所有異步 webContent/<webview> 方法現在返回一個 Promise
為 macOS 添加了 always-on-top-changed
在 Netlog API 中添加 captureMode 和 maxFileSize 選項
在 app.getAppMetrics() 輸出中添加了 creationTime/sandbox/IntegrityLevel
向 webContents.print() 回調函數中添加了 failureReason 參數,以區分成功、失敗和取消
為 BrowserView 添加了 getBalls() 方法
將 gpu-info-update 事件添加到 app 中,只要有 gpu 信息更新,就會發出 gpu-info 更新事件
在 app.getAppMetrics() 添加 memory
添加 process.getBlinkMemoryInfo()
在 webFrame/webContent/<webview> 中添加了 emoveInsertedCSS()
將 zoom-changed 事件添加到 webContent 中
增加列印自定義選項
app.moveToApplicationsFold 添加了一個可選的衝突處理回調
支持 webFrame.sertCSS() 中的 CSS origin
在 Windows 上支持 Tray API 的 mouse-move 事件
Windows 上支持 systemPreferences.isDarkMode() API
macOS 上支持 systemPreferences.isHighContrastColorScheme() API
啟用 W3C Reporting API
macOS 上實現了 BrowserWindow.setFocable
在校驗和文件中添加 Windows on ARM node 頭文件
另外此版本還有許多修復和屬性更改,更多詳情見發布說明。