{"id":13602584,"url":"https://github.com/amhoho/electron-cn-docs","last_synced_at":"2025-04-11T09:30:43.139Z","repository":{"id":41293737,"uuid":"91354177","full_name":"amhoho/electron-cn-docs","owner":"amhoho","description":"Electron中文文档! 精心翻译,完美排版,实时同步更新!, 最后同步:2017-05-23(个人比较忙,本项目已经不再维护了)","archived":false,"fork":false,"pushed_at":"2019-08-10T18:07:03.000Z","size":3132,"stargazers_count":1158,"open_issues_count":9,"forks_count":199,"subscribers_count":51,"default_branch":"master","last_synced_at":"2024-08-02T18:43:07.428Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amhoho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-15T15:32:18.000Z","updated_at":"2024-07-01T02:02:10.000Z","dependencies_parsed_at":"2022-08-10T02:00:43.429Z","dependency_job_id":null,"html_url":"https://github.com/amhoho/electron-cn-docs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amhoho%2Felectron-cn-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amhoho%2Felectron-cn-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amhoho%2Felectron-cn-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amhoho%2Felectron-cn-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amhoho","download_url":"https://codeload.github.com/amhoho/electron-cn-docs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223464886,"owners_count":17149647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T18:01:30.460Z","updated_at":"2024-11-07T05:31:56.240Z","avatar_url":"https://github.com/amhoho.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","JavaScript (485)"],"sub_categories":[],"readme":"## 前言:\n\u003e Electron中文文档! 精心翻译,完美排版,实时同步更新!, 最后同步:2017-05-23\n\u003e 由于比较忙,已经没有维护了,感谢大家的支持!!\n\n### QQ交流群:\n- 群名称：Electron/Nw.js开发交流群\n- 群   号：535260421\n- 创   建：2017-05-19\n- 宗   旨：严禁广告,仅为Electron/Nw.js应用开发交流,译者群主将不定期分享DEMO文件给大家交流学习使用.\n\n### 群内DEMO文件教程列表:\n1. 001自定义托盘菜单界面.zip\n\n![image](demo/images/03.png)\n\n2. 002迅雷悬浮窗右键快捷菜单.zip\n\n![image](demo/images/08.png)\n\n3. 003渲染进程内实时在线或离线提示.zip\n\n![image](demo/images/09.png)\n\n4. 004系统托盘闪烁图标提示用户示例.zip\n\n![image](demo/images/10.gif)\n\n\n## 延伸拓展:\n如果API中所列功能无法满足你的需求时,[chrome-app-samples](https://github.com/GoogleChrome/chrome-app-samples)是你最好的选择.\n\n## 多平台支持:\n众所周知,目前的Electron主要支持桌面版系统的跨平台,例如Win,Linux,MacOS.并不支持(未来可能也不会支持)移动端如Android,iOS等.\n\n相对而言,Electron的门槛非常低,仅需掌握少量Web语言即可入门,但是更多人的需求是:'Write once, run anywhere'(一次撰写，多端运行).\n\n比如,对中国用户而言,Win+Android+iOS三平台支持就是最大的需求主流.\n\n所以此处列举了常见的跨平台开发工具,也欢迎大家推荐更多优秀工具:\n\n### 原生应用\n+ [React-Native](https://github.com/facebook/react-native) -  作者Facebook,Javascript/React,目标平台:iOS/Android\n+ [nativescript](https://github.com/nativescript) - JavaScript,目标平台:iOS/Android/Windows\n+ [CrossAPP](https://github.com/9miao/CrossApp) - C++,目标平台:iOS/Android\n+ [Xamarin](https://developer.xamarin.com/) - C#,目标平台:iOS/Android/Windows/Mac\n+ [QT](http://www.qt.io/mobile-app-development/) - C++,Android/iOS/Windows 10 Mobile/BlackBerry 10/Ubuntu/Sailfish\n+ [JUniversal](http://juniversal.org/) -  Java,目标平台:iOS/Android\n+ [Kivy](http://kivy.org/#home) -Python,目标平台:iOS/Android/Windows/Mac/Linux\n+ [Weex](http://weex.apache.org/cn/) - 作者阿里巴巴,Web,目标平台:iOS/Android\n+ [Flutter](https://github.com/flutter/flutter) -  作者谷歌团队,目标平台:iOS/Android\n\n### 混合应用\n+ [CrossWalk](https://github.com/crosswalk-project/crosswalk)\n+ [Cordova](http://cordova.apache.org/)\n+ [mobile-chrome-apps](https://github.com/MobileChromeApps/mobile-chrome-apps)\n+ [Titanium](https://github.com/appcelerator/titanium.git)\n+ [PhoneGap](https://github.com/phonegap/)\n+ [ionic](https://github.com/driftyco/ionic)\n+ [sencha](https://www.sencha.com/customers/)\n+ [coronalabs](https://coronalabs.com/)\n+ [CocoonJS](https://github.com/ludei/cocoonjs-cli)\n\n### 更多选择\n除了上方列举的开发工具之外,你还可以在[这个页面](http://propertycross.com)上看到更多的工具并欣赏用它们开发的作品截图.\n\n## Electron通用安装(第一二步请选择适合自己的系统):\n\n* 1.[Node.js安装](https://nodejs.org/en/download/)      \n* 2.[git安装](https://git-for-windows.github.io/)     \n* 3.开始菜单中运行cmd或终端中,粘贴下方命令: \n没有翻墙VPN的同学使用:\n ```\nnpm install cnpm -g --registry=http://registry.npm.taobao.org\ncnpm install electron -g               \n```\n可翻墙的同学使用:\n ```\nnpm install electron -g \n```\n\n没有error错误提示的话,这样就安装完成了\n\n你可以在cmd或终端中输入命令 `electron -v` 如果出来个版本号就可以了.\n\n* 4.创建demo应用:将[quick-start](/quick-start)目录中的四个文件放到任意目录,点击 `start.bat`,弹出 `安装成功啦!`提示,即创建成功.\n\n_注意_:[quick-start](/quick-start)目录为示范文件,你可以任意修改.\n\n* 5.electron 常用的npm命令:\n ```\n安装:npm install electron -g \n升级:npm update electron -g\n卸载:npm uninstall electron -g\n```\n\n## Electron学习要点:\n\n1. 由于Electron基于Node.js,对于新手而言,入门第一关应当稍微熟悉[Node.js的文档](https://nodejs.org/dist/latest/docs/doc/api/).            \n\n特别是如os,path等常用模块化的引用,这是非常必要的.\n\n2. Electron文档的学习,本文档中的方法,属性等列举的非常明细,它们的使用方法,你只需稍微观察[quick-start](/quick-start)目录即可明白.\n\n只有一点,你需要特别的记住,Electron分为主进程和渲染进程,这两个进程的概念贯穿全程! \n\n当你遇到需求进行查阅文档时,你需要先判断所属进程,再判断功能区域,这样即可确定API所在章节,例如,调用系统打印机进行打印小票:\n\n * 调用系统打印机(与系统交互类的多数为主进程)\n\n * 打印内容发生在页面内容即功能区域为webcontents([网页内容](api/web-contents.md)章节)    \n\n * API需求为打印,搜 `print`([打印窗口页面](api/web-contents.md#contentsprintoptions))           \n\n## 常见问题:\n\n提交issue前(欢迎提出各种自己想做但不知如何实现的需求),请详读以下常见问题:\n\n* [Electron 常见问题](faq.md)        \n\n## 兼容注意:\n\n* 与Jquery等第三方js插件的兼容相关\n```\n\u003cscript src=`jquery.min.js`\u003e\u003c/script\u003e\n\u003cscript\u003eif (typeof module === 'object') {window.jQuery = window.$ = module.exports;};\u003c/script\u003e\n```\n\n\n## 开发指南目录:\n* [构建说明(Linux)](development/build-instructions-linux.md)   \n* [构建说明(macOS)](development/build-instructions-osx.md)\n* [构建说明(Windows)](development/build-instructions-windows.md)\n* [构建系统概述](development/build-system-overview.md)\n* [编码规范](development/coding-style.md)\n* [在 macOS 中调试](development/debugging-instructions-macos.md)\n* [在 Windows 中调试](development/debug-instructions-windows.md)\n* [在C ++代码中使用clang-format](development/clang-format.md)\n* [在调试器中设置符号服务器](development/setting-up-symbol-server.md)\n* [源代码目录结构](development/source-code-directory-structure.md)\n* [Chrome升级清单](development/upgrading-chrome.md)       \n* [Chromium 开发指南](development/chromium-development.md)       \n* [V8 开发指南](development/v8-development.md)       \n\n## 教程目录:\n* [关于 Electron](tutorial/about.md)\n* [Electron 版本说明](tutorial/electron-versioning.md)\n* [API弃用说明](tutorial/planned-breaking-changes.md)\n* [快速入门](tutorial/quick-start.md)\n* [支持的平台](tutorial/supported-platforms.md)\n* [桌面环境集成](tutorial/desktop-environment-integration.md)\n* [离屏渲染](tutorial/offscreen-rendering.md)\n* [系统通知](tutorial/notifications.md)\n* [在线/离线事件检测](tutorial/online-offline-events.md)\n* [多线程](tutorial/multithreading.md)\n* [REPL](tutorial/repl.md)\n* [键盘快捷键](tutorial/keyboard-shortcuts.md)  \n* [DevTools扩展](tutorial/devtools-extension.md)   \n* [使用原生模块](tutorial/using-native-node-modules.md)   \n* [使用 Pepper Flash 插件](tutorial/using-pepper-flash-plugin.md)      \n* [使用 Selenium 和 WebDriver](tutorial/using-selenium-and-webdriver.md) _(中文官译本,未精校)_\n* [使用 Widevine CDM 插件](tutorial/using-widevine-cdm-plugin.md) _(中文官译本,未精校)_\n* [应用分发](tutorial/application-distribution.md)\n* [应用打包](tutorial/application-packaging.md)\n* [主进程调试](tutorial/debugging-main-process.md)\n* [使用 node-inspector 进行主进程调试](tutorial/debugging-main-process-node-inspector.md)\n* [使用 VSCode 进行主进程调试](tutorial/debugging-main-process-vscode.md)\n* [Mac App Store应用提交指南](tutorial/mac-app-store-submission-guide.md)\n* [Windows App Store应用提交指南](tutorial/windows-store-guide.md) _(中文官译本,未精校)_\n* [安全，本地功能和你的责任](tutorial/security.md) _(中文官译本,未精校)_           \n* [Headless CI Systems 测试](tutorial/testing-on-headless-ci.md) _(中文官译本,未精校)_                  \n\n## API接口目录:\n### 公用: \n* [应用语言](api/locales.md)   \n* [开发概要](api/synopsis.md)  \n* [专业术语](glossary.md)\n* [常见问题](faq.md)\n* [环境变量](api/environment-variables.md)\n* [快捷键字符串](api/accelerator.md)\n* [命令行](api/chrome-command-line-switches.md)\n* [客户端请求](api/client-request.md)\n* [剪贴板](api/clipboard.md) \n* [ `\u003cFile\u003e` H5 File文件操作](api/file-object.md)   \n* [无框窗口](api/frameless-window.md)\n* [ `\u003cwindow.open\u003e` window.open打开新窗口或打开时传递消息](api/window-open.md)                  \n* [沙盒选项](api/sandbox-option.md)       \n\n### 主进程:\n* [整体控制](api/app.md)              \n* [全局快捷键](api/global-shortcut.md)           \n* [图标创建与应用](api/native-image.md)\n* [屏幕](api/screen.md)       \n* [窗口](api/browser-window.md)\n* [菜单](api/menu.md)           \n* [菜单项](api/menu-item.md)\n* [系统托盘](api/tray.md)       \n* [网页内容](api/web-contents.md)\n* [从主进程到渲染进程的异步通信](api/ipc-main.md)          \n* [对话框](api/dialog.md)\n* [创建和控制视图](api/browser-view.md)\n* [会话](api/cookies.md)\n* [会话,缓存和代理等控制](api/session.md)\n* [页面请求](api/web-request.md)\n* [HTTP/HTTPS请求处理](api/incoming-message.md)\n* [协议的注册和处理](api/protocol.md)\n* [使用系统默认应用程序管理文件或URL](api/shell.md)\n* [下载项管理](api/download-item.md)\n* [进程控制](api/process.md)\n* [Chromium原生网络库](api/net.md)\n* [获取系统首选项](api/system-preferences.md)\n* [电源状态](api/power-monitor.md)\n* [节能管理](api/power-save-blocker.md)\n* [调试工具](api/debugger.md)\n* [奔溃报告](api/crash-reporter.md)\n* [性能数据收集](api/content-tracing.md)\n* [自动更新](api/auto-updater.md)\n* [TouchBar触摸条](api/touch-bar.md)\n* [TouchBar触摸条按钮](api/touch-bar-button.md)\n* [TouchBar触摸条拾色器](api/touch-bar-color-picker.md)\n* [TouchBar触摸条分组](api/touch-bar-group.md)        \n* [TouchBar触摸条scrubber](api/touch-bar-scrubber.md)          \n* [TouchBar触摸条分段控件](api/touch-bar-segmented-control.md)      \n* [TouchBar触摸条label标签](api/touch-bar-label.md)\n* [TouchBar触摸条弹出框](api/touch-bar-popover.md)\n* [TouchBar触摸条滑块](api/touch-bar-slider.md)\n* [TouchBar触摸条间隔符](api/touch-bar-spacer.md)                            \n\n### 渲染进程:\n* [页面渲染](api/web-frame.md)   \n* [ `\u003cwebview\u003e` webview标签](api/webview-tag.md)                                                     \n* [渲染进程与主进程通信](api/remote.md)     \n* [从渲染进程到主进程的异步通信](api/ipc-renderer.md)\n* [子窗口](api/browser-window-proxy.md)\n* [捕获桌面资源](api/desktop-capturer.md)                                  \n\n### API中的结构列表:\n* [蓝牙设备对象](api/structures/bluetooth-device.md)\n* [证书对象](api/structures/certificate-principal.md)\n* [证书主体对象](api/structures/certificate.md)\n* [Cookie对象](api/structures/cookie.md)\n* [崩溃报告对象](api/structures/crash-report.md)\n* [桌面捕获源对象](api/structures/desktop-capturer-source.md)\n* [显示器对象](api/structures/display.md)  \n* [打印机信息对象](api/structures/printer-info.md)    \n* [文件过滤器对象](api/structures/file-filter.md)\n* [最近使用的项目](api/structures/jump-list-category.md)\n* [常用列表项](api/structures/jump-list-item.md)\n* [CPU使用率对象即程序占用的CPU资源](api/structures/cpu-usage.md)\n* [IO值对象](api/structures/io-counters.md)\n* [内存信息对象](api/structures/memory-info.md)\n* [进程内存信息对象](api/structures/process-memory-info.md)\n* [内存使用详细信息](api/structures/memory-usage-details.md)\n* [Mime类型缓冲区](api/structures/mime-typed-buffer.md)\n* [矩形对象](api/structures/rectangle.md)\n* [删除客户端证书对象](api/structures/remove-client-certificate.md)\n* [删除密码对象](api/structures/remove-password.md)\n* [Scrubber项对象](api/structures/scrubber-item.md)\n* [分段控制对象](api/structures/segmented-control-segment.md)\n* [快捷方式对象](api/structures/shortcut-details.md)\n* [任务对象](api/structures/task.md)\n* [缩略图工具栏按钮对象](api/structures/thumbar-button.md)\n* [上传blob对象](api/structures/upload-blob.md)\n* [上传数据对象](api/structures/upload-data.md)\n* [上传文件系统对象](api/structures/upload-file-system.md)\n* [上传文件对象](api/structures/upload-file.md)\n* [上传原始数据对象](api/structures/upload-raw-data.md)         \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famhoho%2Felectron-cn-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famhoho%2Felectron-cn-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famhoho%2Felectron-cn-docs/lists"}