From b797804fd92a3bed68223f63434ed3d63ba0f349 Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Fri, 4 Sep 2015 13:44:40 -0700 Subject: [PATCH 01/18] Use "in" over "on" --- docs/api/auto-updater.md | 2 +- docs/api/power-monitor.md | 2 +- docs/api/synopsis.md | 4 ++-- docs/api/web-contents.md | 4 ++-- docs/styleguide.md | 1 + 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/api/auto-updater.md b/docs/api/auto-updater.md index 3901e1be2062..9734f592c8fe 100644 --- a/docs/api/auto-updater.md +++ b/docs/api/auto-updater.md @@ -53,7 +53,7 @@ server that you are requesting updates from. A common approach is to use query parameters, like this: ```javascript -// On the main process +// In the main process var app = require('app'); var autoUpdater = require('auto-updater'); autoUpdater.setFeedUrl('http://mycompany.com/myapp/latest?version=' + app.getVersion()); diff --git a/docs/api/power-monitor.md b/docs/api/power-monitor.md index c9a33cc1a128..6ffb910e164d 100644 --- a/docs/api/power-monitor.md +++ b/docs/api/power-monitor.md @@ -1,7 +1,7 @@ # power-monitor The `power-monitor` module is used to monitor power state changes. You can -only use it on the main process. You should not use this module until the `ready` +only use it in the main process. You should not use this module until the `ready` event of the `app` module is emitted. For example: diff --git a/docs/api/synopsis.md b/docs/api/synopsis.md index 21f4ff2aa4de..85d9e3f8dfa6 100644 --- a/docs/api/synopsis.md +++ b/docs/api/synopsis.md @@ -5,13 +5,13 @@ Electron and third-party node modules also fully supported as well (including the [native modules](../tutorial/using-native-node-modules.md)). Electron also provides some extra built-in modules for developing native -desktop applications. Some modules are only available on the main process, some +desktop applications. Some modules are only available in the main process, some are only available in the renderer process (web page), and some can be used in both processes. The basic rule is: if a module is [GUI](https://en.wikipedia.org/wiki/Graphical_user_interface) or low-level -system related, then it should be only available on the main process. You need +system related, then it should be only available in the main process. You need to be familiar with the concept of [main process vs. renderer process](../tutorial/quick-start.md#the-main-process) scripts to be able to use those modules. diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 89afae43d1c0..c49b64743bed 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -445,7 +445,7 @@ page can handle it by listening to the `channel` event of the `ipc` module. An example of sending messages from the main process to the renderer process: ```javascript -// On the main process. +// In the main process. var window = null; app.on('ready', function() { window = new BrowserWindow({width: 800, height: 600}); @@ -472,6 +472,6 @@ app.on('ready', function() { **Note:** 1. The IPC message handler in web pages does not have an `event` parameter, - which is different from the handlers on the main process. + which is different from the handlers in the main process. 2. There is no way to send synchronous messages from the main process to a renderer process, because it would be very easy to cause dead locks. diff --git a/docs/styleguide.md b/docs/styleguide.md index 23c590e64211..687b5c4dea3e 100644 --- a/docs/styleguide.md +++ b/docs/styleguide.md @@ -25,6 +25,7 @@ These are the ways that we construct the Electron documentation. - Line length is 80-column wrapped. - Platform specific methods are noted in italics following method header. - ```### `method(foo, bar)` _OS X_``` +- Prefer 'in the ___ process' over 'on' ## Reading Electron Documentation From b9da81ee6ac7114dbc10992a284b0225ded2c7c7 Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Fri, 4 Sep 2015 13:50:26 -0700 Subject: [PATCH 02/18] Title Case --- docs/README.md | 56 +++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/docs/README.md b/docs/README.md index 5d6d825d1bcb..4531c1d2a236 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,32 +1,32 @@ ## Guides -* [Application distribution](tutorial/application-distribution.md) -* [Application packaging](tutorial/application-packaging.md) -* [Using native node modules](tutorial/using-native-node-modules.md) -* [Debugging main process](tutorial/debugging-main-process.md) +* [Application Distribution](tutorial/application-distribution.md) +* [Application Packaging](tutorial/application-packaging.md) +* [Using Native Node Modules](tutorial/using-native-node-modules.md) +* [Debugging Main Process](tutorial/debugging-main-process.md) * [Using Selenium and WebDriver](tutorial/using-selenium-and-webdriver.md) -* [DevTools extension](tutorial/devtools-extension.md) -* [Using pepper flash plugin](tutorial/using-pepper-flash-plugin.md) +* [DevTools Extension](tutorial/devtools-extension.md) +* [Using Pepper Flash Plugin](tutorial/using-pepper-flash-plugin.md) ## Tutorials -* [Quick start](tutorial/quick-start.md) -* [Desktop environment integration](tutorial/desktop-environment-integration.md) -* [Online/offline event detection](tutorial/online-offline-events.md) +* [Quick Start](tutorial/quick-start.md) +* [Desktop Environment Integration](tutorial/desktop-environment-integration.md) +* [Online/Offline Event Detection](tutorial/online-offline-events.md) -## API references +## API References * [Synopsis](api/synopsis.md) -* [Process object](api/process.md) -* [Supported Chrome command line switches](api/chrome-command-line-switches.md) +* [Process Object](api/process.md) +* [Supported Chrome Command Line Switches](api/chrome-command-line-switches.md) -Custom DOM elements: +Custom DOM Elements: -* [`File` object](api/file-object.md) -* [`` tag](api/web-view-tag.md) -* [`window.open` function](api/window-open.md) +* [`File` Object](api/file-object.md) +* [`` Tag](api/web-view-tag.md) +* [`window.open` Function](api/window-open.md) -Modules for the main process: +Modules for the Main Process: * [app](api/app.md) * [auto-updater](api/auto-updater.md) @@ -41,16 +41,16 @@ Modules for the main process: * [power-save-blocker](api/power-save-blocker.md) * [protocol](api/protocol.md) * [session](api/session.md) -* [webContents](api/web-contents.md) +* [web-contents](api/web-contents.md) * [tray](api/tray.md) -Modules for the renderer process (web page): +Modules for the Renderer Process (Web Page): * [ipc (renderer)](api/ipc-renderer.md) * [remote](api/remote.md) * [web-frame](api/web-frame.md) -Modules for both processes: +Modules for Both Processes: * [clipboard](api/clipboard.md) * [crash-reporter](api/crash-reporter.md) @@ -60,11 +60,11 @@ Modules for both processes: ## Development -* [Coding style](development/coding-style.md) -* [Source code directory structure](development/source-code-directory-structure.md) -* [Technical differences to NW.js (formerly node-webkit)](development/atom-shell-vs-node-webkit.md) -* [Build system overview](development/build-system-overview.md) -* [Build instructions (Mac)](development/build-instructions-osx.md) -* [Build instructions (Windows)](development/build-instructions-windows.md) -* [Build instructions (Linux)](development/build-instructions-linux.md) -* [Setting up symbol server in debugger](development/setting-up-symbol-server.md) +* [Coding Style](development/coding-style.md) +* [Source Code Directory Structure](development/source-code-directory-structure.md) +* [Technical Differences to NW.js (formerly node-webkit)](development/atom-shell-vs-node-webkit.md) +* [Build System Overview](development/build-system-overview.md) +* [Build Instructions (Mac)](development/build-instructions-osx.md) +* [Build Instructions (Windows)](development/build-instructions-windows.md) +* [Build Instructions (Linux)](development/build-instructions-linux.md) +* [Setting Up Symbol Server in debugger](development/setting-up-symbol-server.md) From b980650b6e1f139d86a09c3c0055517b3a630002 Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Fri, 4 Sep 2015 14:31:33 -0700 Subject: [PATCH 03/18] Use headers so titles are linkable --- docs/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/README.md b/docs/README.md index 4531c1d2a236..b2f95fe4b579 100644 --- a/docs/README.md +++ b/docs/README.md @@ -20,13 +20,13 @@ * [Process Object](api/process.md) * [Supported Chrome Command Line Switches](api/chrome-command-line-switches.md) -Custom DOM Elements: +### Custom DOM Elements: * [`File` Object](api/file-object.md) * [`` Tag](api/web-view-tag.md) * [`window.open` Function](api/window-open.md) -Modules for the Main Process: +### Modules for the Main Process: * [app](api/app.md) * [auto-updater](api/auto-updater.md) @@ -44,13 +44,13 @@ Modules for the Main Process: * [web-contents](api/web-contents.md) * [tray](api/tray.md) -Modules for the Renderer Process (Web Page): +### Modules for the Renderer Process (Web Page): * [ipc (renderer)](api/ipc-renderer.md) * [remote](api/remote.md) * [web-frame](api/web-frame.md) -Modules for Both Processes: +### Modules for Both Processes: * [clipboard](api/clipboard.md) * [crash-reporter](api/crash-reporter.md) From e48f5ea1aabb1fbf091c9d76d78e5e8f1a8cfbab Mon Sep 17 00:00:00 2001 From: Destan Sarpkaya Date: Wed, 9 Sep 2015 14:06:33 +0300 Subject: [PATCH 04/18] update broken link --- docs/api/ipc-main-process.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/ipc-main-process.md b/docs/api/ipc-main-process.md index bbb581fcfc9b..41d4d7125365 100644 --- a/docs/api/ipc-main-process.md +++ b/docs/api/ipc-main-process.md @@ -7,7 +7,7 @@ a renderer will be emitted to this module. ## Sending Messages It is also possible to send messages from the main process to the renderer -process, see [WebContents.send](browser-window.md#webcontentssendchannel-args) +process, see [WebContents.send](browser-window.md#webcontents-send-channel-args) for more information. - When sending a message, the event name is the `channel`. From ce49bba2fc36d3d99ac28066beda4ca0af88f497 Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Wed, 9 Sep 2015 13:32:56 -0700 Subject: [PATCH 05/18] Add section links --- docs/styleguide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/styleguide.md b/docs/styleguide.md index 687b5c4dea3e..d02b7f56861f 100644 --- a/docs/styleguide.md +++ b/docs/styleguide.md @@ -1,7 +1,7 @@ # Electron Documentation Styleguide -Find the appropriate section for your task: [reading Electron documentation](#) -or [writing Electron documentation](#). +Find the appropriate section for your task: [reading Electron documentation](#reading-electron-documentation) +or [writing Electron documentation](#writing-electron-documentation). ## Writing Electron Documentation From e9712e2998a78001998c4ca66fd4f58f80f59677 Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Wed, 9 Sep 2015 13:33:11 -0700 Subject: [PATCH 06/18] Add section on documentation translations --- CONTRIBUTING.md | 1 + docs/styleguide.md | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 61a8e474099a..516f6289ac0f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,6 +29,7 @@ possible with your report. If you can, please include: * Include screenshots and animated GIFs in your pull request whenever possible. * Follow the CoffeeScript, JavaScript, C++ and Python [coding style defined in docs](/docs/development/coding-style.md). * Write documentation in [Markdown](https://daringfireball.net/projects/markdown). + See the [Documentation Styleguide](/docs/styleguide.md). * Use short, present tense commit messages. See [Commit Message Styleguide](#git-commit-messages-styleguide). ## Styleguides diff --git a/docs/styleguide.md b/docs/styleguide.md index d02b7f56861f..77c90467ca93 100644 --- a/docs/styleguide.md +++ b/docs/styleguide.md @@ -27,6 +27,21 @@ These are the ways that we construct the Electron documentation. - ```### `method(foo, bar)` _OS X_``` - Prefer 'in the ___ process' over 'on' +### Documentation Translations + +Translations of the Electron docs are located within the `docs-translations` +directory. + +To add another set (or partial set): + +- Create a subdirectory named by language abbreviation. +- Within that subdirectory, duplicate the `docs` directory, keeping the + names of directories and files same. +- Translate the files. +- Update the `README.md` within your language directory to link to the files + you have translated. +- Add a link to your translation directory on the main Electron [README](https://github.com/atom/electron#documentation-translations). + ## Reading Electron Documentation Here are some tips for understanding Electron documentation syntax. From 6abc4fb2552c344d73a0d062e70aad189d0f8efe Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Wed, 9 Sep 2015 13:48:04 -0700 Subject: [PATCH 07/18] :fire: odd, stray + --- docs/api/browser-window.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index d74e999379ba..ad62cc017cdb 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -117,7 +117,7 @@ Properties `width` and `height` are required. The `BrowserWindow` object emits the following events: -+**Note** Some events are only available on specific operating systems and are labeled as such. +**Note** Some events are only available on specific operating systems and are labeled as such. ### Event: 'page-title-updated' @@ -292,7 +292,7 @@ Remove the devtools extension whose name is `name`. Objects created with `new BrowserWindow` have the following instance methods: -+**Note** Some methods are only available on specific operating systems and are labeled as such. +**Note** Some methods are only available on specific operating systems and are labeled as such. ```javascript var BrowserWindow = require('browser-window'); From 5593717d782dfc2cd549d51bf9fdaf48830ef731 Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Wed, 9 Sep 2015 13:57:35 -0700 Subject: [PATCH 08/18] Create Instance Properties section --- docs/api/browser-window.md | 58 +++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index ad62cc017cdb..a0f29e349da6 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -288,6 +288,42 @@ API is not for programming use. Remove the devtools extension whose name is `name`. + +## Instance Properties + +Objects created with `new BrowserWindow` have the following properties: + +```javascript +var BrowserWindow = require('browser-window'); + +// In this example `win` is our instance +var win = new BrowserWindow({ width: 800, height: 600 }); + +``` + +### `win.webContents` + +The `WebContents` object this window owns, all web page related events and +operations will be done via it. + +See the [`webContents` documentation](web-contents.md) for its methods and +events. + +**Note:** Users should never store this object because it may become `null` +when the renderer process (web page) has crashed. + +### `win.devToolsWebContents` + +The `WebContents` of devtools for this window. + +**Note:** Users should never store this object because it may become `null` +when the devtools has been closed. + +### `win.id` + +The unique ID of this window. + + ## Instance Methods Objects created with `new BrowserWindow` have the following instance methods: @@ -302,28 +338,6 @@ var win = new BrowserWindow({ width: 800, height: 600 }); ``` -### `win.webContents()` - -The `WebContents` object this window owns, all web page related events and -operations will be done via it. - -See the [`webContents` documentation](web-contents.md) for its methods and -events. - -**Note:** Users should never store this object because it may become `null` -when the renderer process (web page) has crashed. - -### `win.devToolsWebContents()` - -Get the `WebContents` of devtools for this window. - -**Note:** Users should never store this object because it may become `null` -when the devtools has been closed. - -### `win.id()` - -Get the unique ID of this window. - ### `win.destroy()` Force closing the window, the `unload` and `beforeunload` event won't be emitted From 1a35d6bda66e8e6e391fd398e43dab99d848ccf8 Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Wed, 9 Sep 2015 14:00:37 -0700 Subject: [PATCH 09/18] :fire: extra lines --- docs/api/browser-window.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index a0f29e349da6..f8df8eda9fb7 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -288,7 +288,6 @@ API is not for programming use. Remove the devtools extension whose name is `name`. - ## Instance Properties Objects created with `new BrowserWindow` have the following properties: @@ -323,7 +322,6 @@ when the devtools has been closed. The unique ID of this window. - ## Instance Methods Objects created with `new BrowserWindow` have the following instance methods: From 279fd0a4610afc6691ab16f0341e3b8f63a998c2 Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Wed, 9 Sep 2015 14:09:14 -0700 Subject: [PATCH 10/18] Standardize **Note:** --- docs/api/app.md | 2 +- docs/api/browser-window.md | 4 ++-- docs/api/global-shortcut.md | 2 +- docs/api/ipc-renderer.md | 4 ++-- docs/api/native-image.md | 2 +- docs/api/remote.md | 2 +- docs/api/screen.md | 2 +- docs/api/tray.md | 2 +- docs/api/web-view-tag.md | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/api/app.md b/docs/api/app.md index 07b26f2c5663..42a5dfc24249 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -152,7 +152,7 @@ Emitted when the gpu process crashes. The `app` object has the following methods: -**Note** Some methods are only available on specific operating systems and are labeled as such. +**Note:** Some methods are only available on specific operating systems and are labeled as such. ### `app.quit()` diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index e9d2c7f6feb8..53a9487733b7 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -117,7 +117,7 @@ Properties `width` and `height` are required. The `BrowserWindow` object emits the following events: -+**Note** Some events are only available on specific operating systems and are labeled as such. ++**Note:** Some events are only available on specific operating systems and are labeled as such. ### Event: 'page-title-updated' @@ -292,7 +292,7 @@ Remove the devtools extension whose name is `name`. Objects created with `new BrowserWindow` have the following instance methods: -+**Note** Some methods are only available on specific operating systems and are labeled as such. ++**Note:** Some methods are only available on specific operating systems and are labeled as such. ```javascript var BrowserWindow = require('browser-window'); diff --git a/docs/api/global-shortcut.md b/docs/api/global-shortcut.md index f9ca654cf50a..adba06e1adcf 100644 --- a/docs/api/global-shortcut.md +++ b/docs/api/global-shortcut.md @@ -4,7 +4,7 @@ The `global-shortcut` module can register/unregister a global keyboard shortcut with the operating system so that you can customize the operations for various shortcuts. -**Note**: The shortcut is global; it will work even if the app does +**Note:** The shortcut is global; it will work even if the app does not have the keyboard focus. You should not use this module until the `ready` event of the app module is emitted. diff --git a/docs/api/ipc-renderer.md b/docs/api/ipc-renderer.md index 3adb0bc95476..752af2ebe293 100644 --- a/docs/api/ipc-renderer.md +++ b/docs/api/ipc-renderer.md @@ -4,7 +4,7 @@ The `ipc` module provides a few methods so you can send synchronous and asynchronous messages from the render process (web page) to the main process. You can also receive replies from the main process. -**Note**: If you want to make use of modules in the main process from the renderer +**Note:** If you want to make use of modules in the main process from the renderer process, you might consider using the [remote](remote.md) module. See [ipc (main process)](ipc-main-process.md) for code examples. @@ -13,7 +13,7 @@ See [ipc (main process)](ipc-main-process.md) for code examples. The `ipc` module has the following methods for sending messages: -**Note**: When using these methods to send a `message` you must also listen +**Note:** When using these methods to send a `message` you must also listen for it in the main process with [`ipc (main process)`](ipc-main-process.md). ### `ipc.send(channel[, arg1][, arg2][, ...])` diff --git a/docs/api/native-image.md b/docs/api/native-image.md index c00ec3a9458a..df2bb96ff9da 100644 --- a/docs/api/native-image.md +++ b/docs/api/native-image.md @@ -74,7 +74,7 @@ mixed with other content to create the desired final appearance. The most common case is to use template images for a menu bar icon so it can adapt to both light and dark menu bars. -**Note**: Template image is only supported on OS X. +**Note:** Template image is only supported on OS X. To mark an image as a template image, its filename should end with the word `Template`. For example: diff --git a/docs/api/remote.md b/docs/api/remote.md index ccb16b4b3cc3..5a048fc0789f 100644 --- a/docs/api/remote.md +++ b/docs/api/remote.md @@ -20,7 +20,7 @@ var win = new BrowserWindow({ width: 800, height: 600 }); win.loadUrl('https://github.com'); ``` -**Note**: for the reverse (access the renderer process from the main process), +**Note:** for the reverse (access the renderer process from the main process), you can use [webContents.executeJavascript](browser-window.md#webcontents-executejavascript-code). ## Remote Objects diff --git a/docs/api/screen.md b/docs/api/screen.md index c22530ca8d0a..934e3eaf5a70 100644 --- a/docs/api/screen.md +++ b/docs/api/screen.md @@ -6,7 +6,7 @@ position, etc. You should not use this module until the `ready` event of the `screen` is an [EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter). -**Note**: In the renderer / DevTools, `window.screen` is a reserved +**Note:** In the renderer / DevTools, `window.screen` is a reserved DOM property, so writing `var screen = require('screen')` will not work. In our examples below, we use `atomScreen` as the variable name instead. diff --git a/docs/api/tray.md b/docs/api/tray.md index a673307804a7..528705acb325 100644 --- a/docs/api/tray.md +++ b/docs/api/tray.md @@ -123,7 +123,7 @@ Emitted when dragged files are dropped in the tray icon. The `Tray` module has the following methods: -**Note**: Some methods are only available on specific operating systems and are +**Note:** Some methods are only available on specific operating systems and are labeled as such. ### `Tray.destroy()` diff --git a/docs/api/web-view-tag.md b/docs/api/web-view-tag.md index 6b64a0269c52..1d49a3db130c 100644 --- a/docs/api/web-view-tag.md +++ b/docs/api/web-view-tag.md @@ -135,7 +135,7 @@ If "on", the guest page will have web security disabled. The `webview` tag has the following methods: -**Note**: The webview element must be loaded before using the methods. +**Note:** The webview element must be loaded before using the methods. **Example** ```javascript From c29a2e4992f6dc063abdb847502790436439b1ba Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Wed, 9 Sep 2015 14:11:06 -0700 Subject: [PATCH 11/18] Standardize DevTools --- docs/api/browser-window.md | 16 ++++++++-------- docs/api/web-contents.md | 4 ++-- docs/api/web-view-tag.md | 8 ++++---- docs/tutorial/debugging-main-process.md | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 53a9487733b7..289f96cd21ea 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -224,15 +224,15 @@ Emitted when the window leaves full screen state triggered by html api. ### Event: 'devtools-opened' -Emitted when devtools is opened. +Emitted when DevTools is opened. ### Event: 'devtools-closed' -Emitted when devtools is closed. +Emitted when DevTools is closed. ### Event: 'devtools-focused' -Emitted when devtools is focused / opened. +Emitted when DevTools is focused / opened. ### Event: 'app-command' _Windows_ @@ -277,7 +277,7 @@ Find a window according to its ID. * `path` String -Adds devtools extension located at `path`, and returns extension's name. +Adds DevTools extension located at `path`, and returns extension's name. The extension will be remembered so you only need to call this API once, this API is not for programming use. @@ -286,7 +286,7 @@ API is not for programming use. * `name` String -Remove the devtools extension whose name is `name`. +Remove the DevTools extension whose name is `name`. ## Instance Methods @@ -315,10 +315,10 @@ when the renderer process (web page) has crashed. ### `win.devToolsWebContents()` -Get the `WebContents` of devtools for this window. +Get the `WebContents` of DevTools for this window. **Note:** Users should never store this object because it may become `null` -when the devtools has been closed. +when the DevTools has been closed. ### `win.id()` @@ -577,7 +577,7 @@ Whether the window's document has been edited. ### `win.openDevTools([options])` * `options` Object (optional). Properties: - * `detach` Boolean - opens devtools in a new window + * `detach` Boolean - opens DevTools in a new window Opens the developer tools. diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index c49b64743bed..7324b6b17976 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -426,13 +426,13 @@ win.webContents.on("did-finish-load", function() { * `path` String -Adds the specified path to devtools workspace. +Adds the specified path to DevTools workspace. ### `webContents.removeWorkSpace(path)` * `path` String -Removes the specified path from devtools workspace. +Removes the specified path from DevTools workspace. ### `webContents.send(channel[, args...])` diff --git a/docs/api/web-view-tag.md b/docs/api/web-view-tag.md index 1d49a3db130c..a61625023bff 100644 --- a/docs/api/web-view-tag.md +++ b/docs/api/web-view-tag.md @@ -242,15 +242,15 @@ user action, can take advantage of this option for automation. ### `.openDevTools()` -Opens a devtools window for guest page. +Opens a DevTools window for guest page. ### `.closeDevTools()` -Closes the devtools window of guest page. +Closes the DevTools window of guest page. ### `.isDevToolsOpened()` -Returns a boolean whether guest page has a devtools window attached. +Returns a boolean whether guest page has a DevTools window attached. ### `.inspectElement(x, y)` @@ -261,7 +261,7 @@ Starts inspecting element at position (`x`, `y`) of guest page. ### `.inspectServiceWorker()` -Opens the devtools for the service worker context present in the guest page. +Opens the DevTools for the service worker context present in the guest page. ### `.setAudioMuted(muted)` diff --git a/docs/tutorial/debugging-main-process.md b/docs/tutorial/debugging-main-process.md index f4e345a2f3a5..38c6e61ffcde 100644 --- a/docs/tutorial/debugging-main-process.md +++ b/docs/tutorial/debugging-main-process.md @@ -1,6 +1,6 @@ # Debugging the Main Process -The browser window devtools can only debug the renderer process scripts (i.e. +The browser window DevTools can only debug the renderer process scripts (i.e. the web pages). In order to provide a way to debug the scripts from the main process, Electron has provided the `--debug` and `--debug-brk` switches. From 60522e0d68191df5cd331bcbe3ee5675c34553d2 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 10 Sep 2015 16:27:15 +0800 Subject: [PATCH 12/18] Bump v0.32.2 --- atom.gyp | 2 +- atom/browser/resources/mac/Info.plist | 2 +- atom/browser/resources/win/atom.rc | 8 ++++---- atom/common/atom_version.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/atom.gyp b/atom.gyp index c78fee1c8e60..5799a00171bc 100644 --- a/atom.gyp +++ b/atom.gyp @@ -4,7 +4,7 @@ 'product_name%': 'Electron', 'company_name%': 'GitHub, Inc', 'company_abbr%': 'github', - 'version%': '0.32.1', + 'version%': '0.32.2', }, 'includes': [ 'filenames.gypi', diff --git a/atom/browser/resources/mac/Info.plist b/atom/browser/resources/mac/Info.plist index 86eef9c09e78..2357054b98ea 100644 --- a/atom/browser/resources/mac/Info.plist +++ b/atom/browser/resources/mac/Info.plist @@ -17,7 +17,7 @@ CFBundleIconFile atom.icns CFBundleVersion - 0.32.1 + 0.32.2 LSMinimumSystemVersion 10.8.0 NSMainNibFile diff --git a/atom/browser/resources/win/atom.rc b/atom/browser/resources/win/atom.rc index bfb464b990a3..2431dcc00ea6 100644 --- a/atom/browser/resources/win/atom.rc +++ b/atom/browser/resources/win/atom.rc @@ -56,8 +56,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,32,1,0 - PRODUCTVERSION 0,32,1,0 + FILEVERSION 0,32,2,0 + PRODUCTVERSION 0,32,2,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -74,12 +74,12 @@ BEGIN BEGIN VALUE "CompanyName", "GitHub, Inc." VALUE "FileDescription", "Electron" - VALUE "FileVersion", "0.32.1" + VALUE "FileVersion", "0.32.2" VALUE "InternalName", "electron.exe" VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved." VALUE "OriginalFilename", "electron.exe" VALUE "ProductName", "Electron" - VALUE "ProductVersion", "0.32.1" + VALUE "ProductVersion", "0.32.2" VALUE "SquirrelAwareVersion", "1" END END diff --git a/atom/common/atom_version.h b/atom/common/atom_version.h index c1d11c91dc87..1e60cb874b75 100644 --- a/atom/common/atom_version.h +++ b/atom/common/atom_version.h @@ -7,7 +7,7 @@ #define ATOM_MAJOR_VERSION 0 #define ATOM_MINOR_VERSION 32 -#define ATOM_PATCH_VERSION 1 +#define ATOM_PATCH_VERSION 2 #define ATOM_VERSION_IS_RELEASE 1 From 9ca85a78598c27459c86a1013c037e78f7c91d13 Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Thu, 10 Sep 2015 10:57:08 -0700 Subject: [PATCH 13/18] Fix electron-rebuild instructions for Win32 --- docs/tutorial/using-native-node-modules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/using-native-node-modules.md b/docs/tutorial/using-native-node-modules.md index 4d61f70cf6db..35876ac230d8 100644 --- a/docs/tutorial/using-native-node-modules.md +++ b/docs/tutorial/using-native-node-modules.md @@ -31,7 +31,7 @@ which handles the manual steps of downloading headers and building native module npm install --save-dev electron-rebuild # Every time you run npm install, run this -./node_modules/.bin/electron-rebuild +npm run electron-rebuild ``` ### The node-gyp Way From 31775aa0493ad4d1edf7596dd94fd7d2e0b80572 Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Thu, 10 Sep 2015 11:00:43 -0700 Subject: [PATCH 14/18] Fix harder --- docs/tutorial/using-native-node-modules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/using-native-node-modules.md b/docs/tutorial/using-native-node-modules.md index 35876ac230d8..c338494cde2b 100644 --- a/docs/tutorial/using-native-node-modules.md +++ b/docs/tutorial/using-native-node-modules.md @@ -31,7 +31,7 @@ which handles the manual steps of downloading headers and building native module npm install --save-dev electron-rebuild # Every time you run npm install, run this -npm run electron-rebuild +node ./node_modules/.bin/electron-rebuild ``` ### The node-gyp Way From 2ac2392a6bfedd406446e9ad994923d2938697c8 Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Thu, 10 Sep 2015 12:11:40 -0700 Subject: [PATCH 15/18] :fire: extra line --- docs/api/browser-window.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 58a708cfb193..a008baaec492 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -313,7 +313,6 @@ when the renderer process (web page) has crashed. ### `win.devToolsWebContents` - Get the `WebContents` of DevTools for this window. **Note:** Users should never store this object because it may become `null` From aae2d82c28022fa7655a53314299104e59293217 Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Thu, 10 Sep 2015 12:19:37 -0700 Subject: [PATCH 16/18] Update links to web-contents.md --- docs/api/browser-window.md | 2 +- docs/api/ipc-main-process.md | 2 +- docs/api/remote.md | 2 +- docs/api/web-view-tag.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 7aa97f75aec3..fb3e7fd40b38 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -263,7 +263,7 @@ Returns the window that is focused in this application. ### `BrowserWindow.fromWebContents(webContents)` -* `webContents` [WebContents](#webcontents) +* `webContents` [WebContents](web-contents.md) Find a window according to the `webContents` it owns. diff --git a/docs/api/ipc-main-process.md b/docs/api/ipc-main-process.md index 41d4d7125365..98d9c3c22d43 100644 --- a/docs/api/ipc-main-process.md +++ b/docs/api/ipc-main-process.md @@ -7,7 +7,7 @@ a renderer will be emitted to this module. ## Sending Messages It is also possible to send messages from the main process to the renderer -process, see [WebContents.send](browser-window.md#webcontents-send-channel-args) +process, see [WebContents.send](web-contents.md#webcontentssendchannel-args) for more information. - When sending a message, the event name is the `channel`. diff --git a/docs/api/remote.md b/docs/api/remote.md index 5a048fc0789f..1c5c831a1790 100644 --- a/docs/api/remote.md +++ b/docs/api/remote.md @@ -21,7 +21,7 @@ win.loadUrl('https://github.com'); ``` **Note:** for the reverse (access the renderer process from the main process), -you can use [webContents.executeJavascript](browser-window.md#webcontents-executejavascript-code). +you can use [webContents.executeJavascript](web-contents.md#webcontentsexecutejavascriptcode-usergesture). ## Remote Objects diff --git a/docs/api/web-view-tag.md b/docs/api/web-view-tag.md index fed2bd144b9a..4647413b5a43 100644 --- a/docs/api/web-view-tag.md +++ b/docs/api/web-view-tag.md @@ -355,7 +355,7 @@ Prints webview's web page as PDF, Same with `webContents.printToPDF(options, cal Send `args..` to guest page via `channel` in asynchronous message, the guest page can handle it by listening to the `channel` event of `ipc` module. -See [WebContents.send](browser-window.md#webcontentssendchannel-args) for +See [WebContents.send](web-contents.md#webcontentssendchannel-args) for examples. ## DOM events From c3664463ab1a4c29fe41ea3e1be0ee90630bd9d3 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Fri, 11 Sep 2015 11:56:36 +0900 Subject: [PATCH 17/18] Update as upstream, fix typos --- README-ko.md | 6 +++++- docs-translations/ko/README.md | 20 +++++++++---------- docs-translations/ko/api/auto-updater.md | 2 +- docs-translations/ko/api/ipc-main-process.md | 2 +- docs-translations/ko/api/remote.md | 2 +- docs-translations/ko/api/web-view-tag.md | 13 ++++++------ docs-translations/ko/api/window-open.md | 4 ++-- docs-translations/ko/styleguide.md | 15 +++++++++++++- .../ko/tutorial/online-offline-events.md | 2 +- .../ko/tutorial/using-native-node-modules.md | 5 +++-- 10 files changed, 45 insertions(+), 26 deletions(-) diff --git a/README-ko.md b/README-ko.md index 9ce6748fc871..83634370eba9 100644 --- a/README-ko.md +++ b/README-ko.md @@ -49,6 +49,10 @@ Electron을 빌드 하는 방법과 프로젝트에 기여하는 방법도 문 ## 커뮤니티 -[Atom 포럼내의 `electron` 카테고리](http://discuss.atom.io/category/electron)와 Freenode `#atom-shell` 채팅 채널에서 활발하게 토론이 이어지고 있습니다. +다음 링크를 통해 커뮤니티에 질문을 올리거나 토론을 나누실 수 있습니다: + +- Atom 포럼의 [`electron`](http://discuss.atom.io/category/electron) 카테고리 +- Freenode 채팅의 `#atom-shell` 채널 +- Slack의 [`Atom`](http://atom-slack.herokuapp.com/) 채널 [awesome-electron](https://github.com/sindresorhus/awesome-electron) 프로젝트엔 커뮤니티가 운영중인 유용한 예제 어플리케이션과 도구, 리소스가 있으니 한번 참고해 보시기 바랍니다. diff --git a/docs-translations/ko/README.md b/docs-translations/ko/README.md index 2c75fa345cff..c79202b4ae89 100644 --- a/docs-translations/ko/README.md +++ b/docs-translations/ko/README.md @@ -2,7 +2,7 @@ * [어플리케이션 배포](tutorial/application-distribution.md) * [어플리케이션 패키징](tutorial/application-packaging.md) -* [네이티브 node 모듈 사용하기](tutorial/using-native-node-modules.md) +* [네이티브 Node 모듈 사용하기](tutorial/using-native-node-modules.md) * [메인 프로세스 디버깅하기](tutorial/debugging-main-process.md) * [Selenium 과 WebDriver 사용하기](tutorial/using-selenium-and-webdriver.md) * [개발자 콘솔 확장기능](tutorial/devtools-extension.md) @@ -12,21 +12,21 @@ * [시작하기](tutorial/quick-start.md) * [데스크톱 환경 통합](tutorial/desktop-environment-integration.md) -* [온라인/오프라인 이벤트](tutorial/online-offline-events.md) +* [온라인/오프라인 이벤트 감지](tutorial/online-offline-events.md) ## API 레퍼런스 * [개요](api/synopsis.md) -* [process](api/process.md) -* [크롬 Command-Line 스위치 지원](api/chrome-command-line-switches.md) +* [Process 객체](api/process.md) +* [크롬 Command Line 스위치 지원](api/chrome-command-line-switches.md) -커스텀 DOM elements: +### 커스텀 DOM elements: * [`File` 객체](api/file-object.md) * [`` 태그](api/web-view-tag.md) -* [`window.open` 메서드](api/window-open.md) +* [`window.open` 함수](api/window-open.md) -메인 프로세스를 위한 모듈들: +### 메인 프로세스를 위한 모듈들: * [app](api/app.md) * [auto-updater](api/auto-updater.md) @@ -41,16 +41,16 @@ * [power-save-blocker](api/power-save-blocker.md) * [protocol](api/protocol.md) * [session](api/session.md) -* [webContents](api/web-contents.md) +* [web-contents](api/web-contents.md) * [tray](api/tray.md) -랜더러 프로세스를 위한 모듈들 (웹 페이지): +### 랜더러 프로세스를 위한 모듈들 (웹 페이지): * [ipc (renderer)](api/ipc-renderer.md) * [remote](api/remote.md) * [web-frame](api/web-frame.md) -두 프로세스에서 모두 사용 가능한 모듈들: +### 두 프로세스에서 모두 사용 가능한 모듈들: * [clipboard](api/clipboard.md) * [crash-reporter](api/crash-reporter.md) diff --git a/docs-translations/ko/api/auto-updater.md b/docs-translations/ko/api/auto-updater.md index 1b586d5cdd5d..23f881c32ba8 100644 --- a/docs-translations/ko/api/auto-updater.md +++ b/docs-translations/ko/api/auto-updater.md @@ -38,7 +38,7 @@ Squirrel은 응답을 분석해야 할 책임이 있기 때문에 `Accept: appli 버전 식별자와 다른 기준을 특정하는 업데이트 요청 폼을 서버로 전달하기 위한 공통적인 방법으로 쿼리 인자를 사용하는 방법이 있습니다: ```javascript -// On the main process +// In the main process var app = require('app'); var autoUpdater = require('auto-updater'); autoUpdater.setFeedUrl('http://mycompany.com/myapp/latest?version=' + app.getVersion()); diff --git a/docs-translations/ko/api/ipc-main-process.md b/docs-translations/ko/api/ipc-main-process.md index 496afd203318..ad4e545ce474 100644 --- a/docs-translations/ko/api/ipc-main-process.md +++ b/docs-translations/ko/api/ipc-main-process.md @@ -6,7 +6,7 @@ ## 메시지 전송 물론 메인 프로세스에서 랜더러 프로세스로 메시지를 보내는 것도 가능합니다. -자세한 내용은 [WebContents.send](browser-window.md#webcontentssendchannel-args)를 참고하세요. +자세한 내용은 [WebContents.send](web-contents.md#webcontentssendchannel-args)를 참고하세요. - 메시지를 전송할 때 이벤트 이름은 `channel`이 됩니다. - 메시지에 동기로 응답할 땐 반드시 `event.returnValue`를 설정해야 합니다. diff --git a/docs-translations/ko/api/remote.md b/docs-translations/ko/api/remote.md index 34492a30556f..15c82ff0d21e 100644 --- a/docs-translations/ko/api/remote.md +++ b/docs-translations/ko/api/remote.md @@ -17,7 +17,7 @@ var win = new BrowserWindow({ width: 800, height: 600 }); win.loadUrl('https://github.com'); ``` -**참고:** 반대로 메인 프로세스에서 랜더러 프로세스에 접근 하려면 [webContents.executeJavascript](browser-window.md#webcontents-executejavascript-code) 메서드를 사용하면 됩니다. +**참고:** 반대로 메인 프로세스에서 랜더러 프로세스에 접근 하려면 [webContents.executeJavascript](web-contents.md#webcontentsexecutejavascriptcode-usergesture) 메서드를 사용하면 됩니다. ## Remote 객체 diff --git a/docs-translations/ko/api/web-view-tag.md b/docs-translations/ko/api/web-view-tag.md index b4af6d3ea87f..90f5acb9381f 100644 --- a/docs-translations/ko/api/web-view-tag.md +++ b/docs-translations/ko/api/web-view-tag.md @@ -139,7 +139,7 @@ `webview` 태그는 다음과 같은 메서드를 가지고 있습니다: -**참고:** Webview 메서드는 페이지 로드가 끝난 뒤에만 사용할 수 있습니다. +**참고:** 태그 객체의 메서드는 페이지 로드가 끝난 뒤에만 사용할 수 있습니다. **예제** ```javascript @@ -248,15 +248,15 @@ webview.addEventListener("dom-ready", function() { ### `.openDevTools()` -페이지에 대한 개발자 툴을 엽니다. +페이지에 대한 개발자 콘솔을 엽니다. ### `.closeDevTools()` -페이지에 대한 개발자 툴을 닫습니다. +페이지에 대한 개발자 콘솔을 닫습니다. ### `.isDevToolsOpened()` -페이지에 대한 개발자 툴이 열려있는지 확인합니다. 불린 값을 반환합니다. +페이지에 대한 개발자 콘솔이 열려있는지 확인합니다. 불린 값을 반환합니다. ### `.inspectElement(x, y)` @@ -267,7 +267,7 @@ webview.addEventListener("dom-ready", function() { ### `.inspectServiceWorker()` -Service worker에 대한 개발자 툴을 엽니다. +Service worker에 대한 개발자 콘솔을 엽니다. ### `.undo()` @@ -333,7 +333,7 @@ Webview 페이지를 PDF 형식으로 인쇄합니다. `webContents.printToPDF(o `channel`을 통해 페이지에 `args` 비동기 메시지를 보냅니다. 페이지에선 `ipc` 모듈의 `channel` 이벤트를 사용하면 이 메시지를 받을 수 있습니다. -예제는 [WebContents.send](browser-window.md#webcontentssendchannel-args)를 참고하세요. +예제는 [WebContents.send](web-contents.md#webcontentssendchannel-args)를 참고하세요. ## DOM 이벤트 @@ -360,6 +360,7 @@ Returns: * `errorCode` Integer * `errorDescription` String +* `validatedUrl` String `did-finish-load`와 비슷합니다. 하지만 이 이벤트는 `window.stop()`과 같은 무언가로 인해 로드에 실패했을 때 발생하는 이벤트입니다. diff --git a/docs-translations/ko/api/window-open.md b/docs-translations/ko/api/window-open.md index 4187672331f4..a4cf3bce5c93 100644 --- a/docs-translations/ko/api/window-open.md +++ b/docs-translations/ko/api/window-open.md @@ -1,6 +1,6 @@ -# `window.open` 메서드 +# `window.open` 함수 -`window.open` 메서드가 호출되면 새 창을 생성하고 `url` 페이지를 불러옵니다. +`window.open` 함수가 호출되면 새 창을 생성하고 `url` 페이지를 불러옵니다. 이 창은 지정한 `url`을 로드하여 만들어진 `BrowserWindow`의 새 인스턴스이며 본래 창 객체 대신 페이지의 컨트롤이 제한된 프록시 객체를 반환합니다. 프록시 객체는 브라우저의 웹 페이지 창과 호환될 수 있도록 일부 제한된 표준 기능만 가지고 있습니다. diff --git a/docs-translations/ko/styleguide.md b/docs-translations/ko/styleguide.md index 1168556a3d7b..aaa9274cd0b7 100644 --- a/docs-translations/ko/styleguide.md +++ b/docs-translations/ko/styleguide.md @@ -1,6 +1,6 @@ # Electron 문서 스타일 가이드 -[Electron 문서 읽기](#) 와 [Electron 문서 작성하기](#) 중 적당히 필요한 부분을 찾아 참고하세요: +[Electron 문서 읽기](#electron-문서-읽기) 와 [Electron 문서 작성하기](#electron-문서-작성하기) 중 이해가 필요한 부분을 찾아 참고하세요: ## Electron 문서 작성하기 @@ -22,6 +22,19 @@ Electron 문서를 작성하는 규칙은 다음과 같습니다. - 문장의 길이는 한 줄당 80 칸을 유지합니다. - 플랫폼 특정 메서드 헤더는 이탈릭체로 표시합니다. - ```### `method(foo, bar)` _OS X_``` +- 'on' 표현 대신 'in the ___ process' 형식의 표현을 지향합니다. + +### 번역된 참조 문서 + +번역된 Electron의 참조 문서는 `docs-translations` 디렉터리에 있습니다. + +아직 번역되지 않은 언어를 추가하려면 (일부분 포함): + +- 언어의 약어(예: en, ja, ko등)로 서브 디렉터리를 만듭니다. +- 서브 디렉터리에 `docs` 디렉터리를 복사합니다. 파일 이름과 디렉터리 구조는 모두 유지합니다. +- 문서를 번역합니다. +- `README.md`에 번역한 문서의 링크를 추가하고 업데이트 합니다. +- 메인 Electron의 [README](https://github.com/atom/electron#documentation-translations)에 번역된 디렉터리의 링크를 추가합니다. ## Electron 문서 읽기 diff --git a/docs-translations/ko/tutorial/online-offline-events.md b/docs-translations/ko/tutorial/online-offline-events.md index 57e0f48a3e0d..cc8ae4855d55 100644 --- a/docs-translations/ko/tutorial/online-offline-events.md +++ b/docs-translations/ko/tutorial/online-offline-events.md @@ -1,4 +1,4 @@ -# 온라인/오프라인 이벤트 +# 온라인/오프라인 이벤트 감지 온라인/오프라인 이벤트는 다음 예제와 같이 랜더러 프로세스에서 표준 HTML5 API를 이용하여 구현할 수 있습니다. diff --git a/docs-translations/ko/tutorial/using-native-node-modules.md b/docs-translations/ko/tutorial/using-native-node-modules.md index f9cb2be3bf53..913c300be881 100644 --- a/docs-translations/ko/tutorial/using-native-node-modules.md +++ b/docs-translations/ko/tutorial/using-native-node-modules.md @@ -19,13 +19,14 @@ Node v0.11.x 버전부터는 V8 API의 중대한 변경이 있었습니다. 하 ### 쉬운 방법 [`electron-rebuild`](https://github.com/paulcbetts/electron-rebuild) 패키지를 사용하면 빠르고 간단하게 네이티브 모듈을 다시 빌드할 수 있습니다. -간단한 절차를 통해 자동으로 헤더를 다운로드하고 네이티브 모듈을 빌드할 수 있습니다: + +다음 예제는 `electron-rebuild`를 통해 자동으로 모듈의 헤더를 다운로드하고 네이티브 모듈을 빌드합니다: ```sh npm install --save-dev electron-rebuild # 필요한 네이티브 모듈을 `npm install`로 설치한 후 다음 명령을 실행하세요: -./node_modules/.bin/electron-rebuild +node ./node_modules/.bin/electron-rebuild ``` ### node-gyp을 이용한 방법 From 750d3e979c04d3223f45137f57814003aec24cc2 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Fri, 11 Sep 2015 13:30:37 +0900 Subject: [PATCH 18/18] Add session.md as translated, mark untranslated files in README.md --- docs-translations/ko/README.md | 6 +- docs-translations/ko/api/session.md | 187 ++++++++++++++++++++++++++++ 2 files changed, 190 insertions(+), 3 deletions(-) create mode 100644 docs-translations/ko/api/session.md diff --git a/docs-translations/ko/README.md b/docs-translations/ko/README.md index c79202b4ae89..2fb242fae906 100644 --- a/docs-translations/ko/README.md +++ b/docs-translations/ko/README.md @@ -28,9 +28,9 @@ ### 메인 프로세스를 위한 모듈들: -* [app](api/app.md) +* [app (0% 번역됨)](api/app.md) * [auto-updater](api/auto-updater.md) -* [browser-window](api/browser-window.md) +* [browser-window (0% 번역됨)](api/browser-window.md) * [content-tracing](api/content-tracing.md) * [dialog](api/dialog.md) * [global-shortcut](api/global-shortcut.md) @@ -41,7 +41,7 @@ * [power-save-blocker](api/power-save-blocker.md) * [protocol](api/protocol.md) * [session](api/session.md) -* [web-contents](api/web-contents.md) +* [web-contents (0% 번역됨)](api/web-contents.md) * [tray](api/tray.md) ### 랜더러 프로세스를 위한 모듈들 (웹 페이지): diff --git a/docs-translations/ko/api/session.md b/docs-translations/ko/api/session.md new file mode 100644 index 000000000000..cb912aabb100 --- /dev/null +++ b/docs-translations/ko/api/session.md @@ -0,0 +1,187 @@ +# session + +`session` 객체는 [`BrowserWindow`](browser-window.md)의 [`webContents`](web-contents.md)의 프로퍼티입니다. +다음과 같이 `BrowserWindow` 인스턴스에서 접근할 수 있습니다: + +```javascript +var BrowserWindow = require('browser-window'); + +var win = new BrowserWindow({ width: 800, height: 600 }); +win.loadUrl("http://github.com"); + +var session = win.webContents.session +``` + +## Events + +### Event: 'will-download' + +* `event` Event +* `item` Object + * `url` String + * `filename` String + * `mimeType` String + * `hasUserGesture` Boolean +* `webContents` [WebContents](web-contents.md) + +Electron의 `webContents`에서 `item`을 다운로드할 때 발생하는 이벤트입니다. + +`event.preventDefault()` 메서드를 호출하면 다운로드를 취소합니다. + +```javascript +session.on('will-download', function(event, item, webContents) { + event.preventDefault(); + require('request')(item.url, function(data) { + require('fs').writeFileSync('/somewhere', data); + }); +}); +``` + +## Methods + +`session` 객체는 다음과 같은 메서드와 속성을 가지고 있습니다: + +### `session.cookies` + +`cookies` 속성은 쿠키를 조작하는 방법을 제공합니다. 예를 들어 다음과 같이 할 수 있습니다: + +```javascript +var BrowserWindow = require('browser-window'); + +var win = new BrowserWindow({ width: 800, height: 600 }); + +win.loadUrl('https://github.com'); + +win.webContents.on('did-finish-load', function() { + // 모든 쿠키를 가져옵니다. + win.webContents.session.cookies.get({}, function(error, cookies) { + if (error) throw error; + console.log(cookies); + }); + + // Url에 관련된 쿠키를 모두 가져옵니다. + win.webContents.session.cookies.get({ url : "http://www.github.com" }, + function(error, cookies) { + if (error) throw error; + console.log(cookies); + }); + + // 지정한 쿠키 데이터를 설정합니다. + // 동일한 쿠키가 있으면 해당 쿠키를 덮어씁니다. + win.webContents.session.cookies.set( + { url : "http://www.github.com", name : "dummy_name", value : "dummy"}, + function(error, cookies) { + if (error) throw error; + console.log(cookies); + }); +}); +``` + +### `session.cookies.get(details, callback)` + +`details` Object, properties: + +* `url` String - `url`에 관련된 쿠키를 가져옵니다. 이 속성을 비워두면 모든 url의 쿠키를 가져옵니다. +* `name` String - 이름을 기준으로 쿠키를 필터링합니다. +* `domain` String - `domain`과 일치하는 도메인과 서브 도메인에 대한 쿠키를 가져옵니다. +* `path` String - `path`와 일치하는 경로에 대한 쿠키를 가져옵니다. +* `secure` Boolean - 보안 속성을 기준으로 쿠키를 필터링합니다. +* `session` Boolean - 세션 또는 영구 쿠키를 필터링합니다. + +* `callback` Function - function(error, cookies) +* `error` Error +* `cookies` Array - `cookie` 객체의 배열, 속성은 다음과 같습니다: + * `name` String - 쿠키의 이름. + * `value` String - 쿠키의 값. + * `domain` String - 쿠키의 도메인. + * `host_only` String - 쿠키가 호스트 전용인가에 대한 여부. + * `path` String - 쿠키의 경로. + * `secure` Boolean - 쿠키가 안전한 것으로 표시되는지에 대한 여부. (일반적으로 HTTPS) + * `http_only` Boolean - 쿠키가 HttpOnly로 표시되는지에 대한 여부. + * `session` Boolean - 쿠키가 세션 쿠키 또는 만료일이 있는 영구 쿠키인지에 대한 여부. + * `expirationDate` Double - (Option) UNIX 시간으로 표시되는 쿠키의 만료일에 대한 초 단위 시간. 세션 쿠키는 지원되지 않음. + +### `session.cookies.set(details, callback)` + +`details` Object, properties: + +* `url` String - `url`에 관련된 쿠키를 가져옵니다. +* `name` String - 쿠키의 이름입니다. 기본적으로 비워두면 생략됩니다. +* `value` String - 쿠키의 값입니다. 기본적으로 비워두면 생략됩니다. +* `domain` String - 쿠키의 도메인입니다. 기본적으로 비워두면 생략됩니다. +* `path` String - 쿠키의 경로입니다. 기본적으로 비워두면 생략됩니다. +* `secure` Boolean - 쿠키가 안전한 것으로 표시되는지에 대한 여부입니다. 기본값은 false입니다. +* `session` Boolean - 쿠키가 HttpOnly로 표시되는지에 대한 여부입니다. 기본값은 false입니다. +* `expirationDate` Double - UNIX 시간으로 표시되는 쿠키의 만료일에 대한 초 단위 시간입니다. 생략하면 쿠키는 세션 쿠키가 됩니다. + +* `callback` Function - function(error) + * `error` Error + +### `session.cookies.remove(details, callback)` + +* `details` Object, proprties: + * `url` String - 쿠키와 관련된 URL입니다. + * `name` String - 지울 쿠키의 이름입니다. +* `callback` Function - function(error) + * `error` Error + +### `session.clearCache(callback)` + +* `callback` Function - 작업이 완료되면 호출됩니다. + +세션의 HTTP 캐시를 비웁니다. + +### `session.clearStorageData([options, ]callback)` + +* `options` Object (optional), proprties: + * `origin` String - `scheme://host:port`와 같은 `window.location.origin` 규칙을 따르는 origin 문자열. + * `storages` Array - 비우려는 스토리지의 종류, 다음과 같은 타입을 포함할 수 있습니다: + `appcache`, `cookies`, `filesystem`, `indexdb`, `local storage`, + `shadercache`, `websql`, `serviceworkers` + * `quotas` Array - 비우려는 할당의 종류, 다음과 같은 타입을 포함할 수 있습니다: + `temporary`, `persistent`, `syncable`. +* `callback` Function - 작업이 완료되면 호출됩니다. + +웹 스토리지의 데이터를 비웁니다. + +### `session.setProxy(config, callback)` + +* `config` String +* `callback` Function - 작업이 완료되면 호출됩니다. + +세션에 사용할 프록시 `config`를 분석하고 프록시를 적용합니다. + +``` +config = scheme-proxies[";"] +scheme-proxies = ["="] +url-scheme = "http" | "https" | "ftp" | "socks" +proxy-uri-list = [","] +proxy-uri = ["://"][":"] + + 예시: + "http=foopy:80;ftp=foopy2" -- use HTTP proxy "foopy:80" for http:// + URLs, and HTTP proxy "foopy2:80" for + ftp:// URLs. + "foopy:80" -- use HTTP proxy "foopy:80" for all URLs. + "foopy:80,bar,direct://" -- use HTTP proxy "foopy:80" for all URLs, + failing over to "bar" if "foopy:80" is + unavailable, and after that using no + proxy. + "socks4://foopy" -- use SOCKS v4 proxy "foopy:1080" for all + URLs. + "http=foopy,socks5://bar.com -- use HTTP proxy "foopy" for http URLs, + and fail over to the SOCKS5 proxy + "bar.com" if "foopy" is unavailable. + "http=foopy,direct:// -- use HTTP proxy "foopy" for http URLs, + and use no proxy if "foopy" is + unavailable. + "http=foopy;socks=foopy2 -- use HTTP proxy "foopy" for http URLs, + and use socks4://foopy2 for all other + URLs. +``` + +### `session.setDownloadPath(path)` + +* `path` String - 다운로드 위치 + +다운로드 저장 위치를 지정합니다. 기본 다운로드 위치는 각 어플리케이션 데이터 디렉터리의 `Downloads` 폴더입니다.