Skip to main content

使用 JavaScript、HTML 和 CSS 构建跨平台桌面应用

Web 驱动

Electron 嵌入了 Chromium 和 Node.js,将 JavaScript 带到了桌面。

跨平台

Electron 应用可在所有受支持的架构上的 macOS、Windows 和 Linux 上原生运行。

向所有人开放

Electron 是 OpenJS 基金会 下属的一个开源项目,由活跃的贡献者社区维护。

稳定

Electron 捆绑的 Chromium 构建确保你的应用具有稳定的渲染目标以及所有最新的 Web 平台功能。

安全

Electron 与 Chromium 同步发布主要版本,因此你可以在安全修复程序可用时立即获得修复。

可扩展

使用丰富的 npm 生态系统中的任何包,或者编写你自己 原生插件代码 来扩展 Electron。

桌面开发变得简单

Electron 负责处理困难部分,因此你可以专注于应用的核心。

macOS operating system menu for VSCode. 'Code' menu item is selected, and its submenu has items 'About Visual Studio Code', 'Check for Updates...', 'Preferences', 'Services', 'Hide Visual Studio Code', 'Hide Others', 'Show All', 'Quit Visual Studio Code'.

原生图形用户界面

使用 Electron 的主进程 API 与操作系统的接口进行交互。 自定义 应用窗口 外观、控制应用 菜单、或通过 对话框通知 提醒用户。

Dialog for Electron Fiddle's auto-update. The user is prompted to update to v0.27.3. 'A new version has been downloaded. Restart the application to apply the updates.' There are two buttons underneath: 'Later' and 'Restart'.

自动软件更新

每当你发布新版本时,都会使用由 Squirrel 提供支持的 Electron 自动更新模块 向 macOS 和 Windows 用户发送软件更新。

Window on macOS for the WhatsApp Installer (DMG). Two icons are present: 'WhatsApp' and 'Applications'. The user is prompted to drag the WhatsApp app icon into the Applications folder.

应用安装程序

使用 社区支持的工具 生成特定于平台的工具,例如 macOS 上的 Apple 磁盘映像 (.dmg)、Windows 上的 Windows 安装程序 (.msi) 或 Linux 上的 RPM 包管理器 (.rpm)。

Mac App Store window open to the Rocket.Chat download page.

应用商店分布

将你的应用分发给更多用户。 Electron 对 Mac App Store (macOS)、Microsoft Store (Windows) 或 Snap Store (Linux) 提供一流的支持。

Screenshot of Sentry crash reporting (https://sentry.io). Shows the error message ('BrowserWindow Unresponsive'), user breadcrumbs, and user information.

崩溃报告

使用 崩溃报告器 模块自动收集用户的 JavaScript 和原生崩溃数据。 使用第三方服务来收集此数据或设置你自己的本地 Crashpad 服务器。