From fe5dc5d28edebd4a9b80ea6f49e201ae61fec060 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Mon, 9 May 2016 10:43:52 +0900 Subject: [PATCH 1/7] :memo: Update Korean docs as upstream [ci skip] --- docs-translations/ko-KR/api/web-contents.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs-translations/ko-KR/api/web-contents.md b/docs-translations/ko-KR/api/web-contents.md index 3405d5f0266e..f3df544cf3c1 100644 --- a/docs-translations/ko-KR/api/web-contents.md +++ b/docs-translations/ko-KR/api/web-contents.md @@ -646,9 +646,9 @@ mainWindow.webContents.on('devtools-opened', function() { * `options` Object (optional) * `detach` Boolean - 새 창에서 개발자 도구를 엽니다. - * `mode` String - 개발자 도구 표시 상태를 지정합니다. 옵션은 "right", "bottom", - "undocked", "detach"가 될 수 있습니다. 기본값은 마지막 표시 상태를 - 사용합니다. `undocked` 모드에선 다시 독을 할 수 있습니다. 하지만 `detach` + * `mode` String - 개발자 도구를 지정한 도킹 상태와 함께 엽니다. 옵션은 `right`, + `bottom`, `undocked`, `detach`가 될 수 있습니다. 기본값은 마지막 표시 상태를 + 사용합니다. `undocked` 모드에선 다시 도킹을 할 수 있습니다. 하지만 `detach` 모드에선 할 수 없습니다. 개발자 도구를 엽니다. From ad4450ec884efdae644b0214621d8a14cd4d1ae8 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Mon, 9 May 2016 11:23:46 +0900 Subject: [PATCH 2/7] :memo: Small fixes [ci skip] --- docs-translations/ko-KR/api/clipboard.md | 2 +- docs-translations/ko-KR/api/content-tracing.md | 2 +- docs-translations/ko-KR/api/dialog.md | 2 +- docs-translations/ko-KR/api/ipc-renderer.md | 2 +- docs-translations/ko-KR/api/protocol.md | 6 +++--- docs-translations/ko-KR/api/web-view-tag.md | 2 +- docs-translations/ko-KR/api/window-open.md | 2 +- .../ko-KR/development/build-instructions-windows.md | 2 +- .../ko-KR/development/debug-instructions-windows.md | 4 ++-- .../ko-KR/tutorial/desktop-environment-integration.md | 6 +++--- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs-translations/ko-KR/api/clipboard.md b/docs-translations/ko-KR/api/clipboard.md index 83775dfa78b8..0590713e83b3 100644 --- a/docs-translations/ko-KR/api/clipboard.md +++ b/docs-translations/ko-KR/api/clipboard.md @@ -7,7 +7,7 @@ const clipboard = require('electron').clipboard; clipboard.writeText('Example String'); ``` -X Window 시스템에선 selection 클립보드도 존재합니다. 이를 사용하려면 인자 뒤에 +X Window 시스템에선 selection 클립보드도 존재합니다. 이를 사용하려면 인수 뒤에 `selection` 문자열을 같이 지정해주어야 합니다: ```javascript diff --git a/docs-translations/ko-KR/api/content-tracing.md b/docs-translations/ko-KR/api/content-tracing.md index 484197e20738..ac923ee9fe90 100644 --- a/docs-translations/ko-KR/api/content-tracing.md +++ b/docs-translations/ko-KR/api/content-tracing.md @@ -36,7 +36,7 @@ contentTracing.startRecording(options, function() { 카테고리 그룹 세트를 가져옵니다. 카테고리 그룹은 도달된 코드 경로를 변경할 수 있습니다. 모든 child 프로세스가 `getCategories` 요청을 승인하면 `callback`이 한 번 호출되며 -인자에 카테고리 그룹의 배열이 전달됩니다. +인수에 카테고리 그룹의 배열이 전달됩니다. ### `contentTracing.startRecording(options, callback)` diff --git a/docs-translations/ko-KR/api/dialog.md b/docs-translations/ko-KR/api/dialog.md index 90d76df16692..2110e376c27c 100644 --- a/docs-translations/ko-KR/api/dialog.md +++ b/docs-translations/ko-KR/api/dialog.md @@ -131,7 +131,7 @@ Linux에서 `ready` 이벤트가 발생하기 전에 이 API를 호출할 경우 ## Sheets -Mac OS X에선, `browserWindow` 인자에 `BrowserWindow` 객체 참조를 전달하면 대화 +Mac OS X에선, `browserWindow` 인수에 `BrowserWindow` 객체 참조를 전달하면 대화 상자가 해당 윈도우에 시트처럼 표시되도록 표현할 수 있습니다. 윈도우의 객체 참조가 제공되지 않으면 모달 형태로 표시됩니다. diff --git a/docs-translations/ko-KR/api/ipc-renderer.md b/docs-translations/ko-KR/api/ipc-renderer.md index 19681515fefc..3584d41b556d 100644 --- a/docs-translations/ko-KR/api/ipc-renderer.md +++ b/docs-translations/ko-KR/api/ipc-renderer.md @@ -67,7 +67,7 @@ * `arg` (optional) `channel`을 통해 메인 프로세스에 동기 메시지를 보냅니다. 그리고 필요에 따라 임의의 -인자를 사용할 수도 있습니다. 인수들은 내부적으로 JSON 포맷으로 직렬화 되며, 이후 함수와 +인수를 사용할 수도 있습니다. 인수들은 내부적으로 JSON 포맷으로 직렬화 되며, 이후 함수와 프로토타입 체인은 포함되지 않게 됩니다. 메인 프로세스는 `ipcMain` 모듈을 통해 `channel` 이벤트를 리스닝 할 수 있고, diff --git a/docs-translations/ko-KR/api/protocol.md b/docs-translations/ko-KR/api/protocol.md index 51207f8e0ee7..40ee6f192dd7 100644 --- a/docs-translations/ko-KR/api/protocol.md +++ b/docs-translations/ko-KR/api/protocol.md @@ -62,12 +62,12 @@ The `uploadData` is an array of `data` objects: * `bytes` Buffer - Content being sent. * `file` String - Path of file being uploaded. -`request`를 처리할 때 반드시 파일 경로 또는 `path` 속성을 포함하는 객체를 인자에 +`request`를 처리할 때 반드시 파일 경로 또는 `path` 속성을 포함하는 객체를 인수에 포함하여 `callback`을 호출해야 합니다. 예: `callback(filePath)` 또는 `callback({path: filePath})`. -만약 `callback`이 아무 인자도 없이 호출되거나 숫자나 `error` 프로퍼티를 가진 객체가 -인자로 전달될 경우 `request`는 지정한 `error` 코드(숫자)를 출력합니다. 사용할 수 있는 +만약 `callback`이 아무 인수도 없이 호출되거나 숫자나 `error` 프로퍼티를 가진 객체가 +인수로 전달될 경우 `request`는 지정한 `error` 코드(숫자)를 출력합니다. 사용할 수 있는 에러 코드는 [네트워크 에러 목록][net-error]에서 확인할 수 있습니다. 기본적으로 `scheme`은 `http:`와 같이 처리됩니다. `file:`과 같이 "일반적인 URI 문법" diff --git a/docs-translations/ko-KR/api/web-view-tag.md b/docs-translations/ko-KR/api/web-view-tag.md index ae446975ef28..63b6a92ae896 100644 --- a/docs-translations/ko-KR/api/web-view-tag.md +++ b/docs-translations/ko-KR/api/web-view-tag.md @@ -450,7 +450,7 @@ Webview 페이지를 PDF 형식으로 인쇄합니다. * `args` (optional) `channel`을 통해 렌더러 프로세스로 비동기 메시지를 보냅니다. 또한 `args`를 지정하여 -임의의 인자를 보낼 수도 있습니다. 렌더러 프로세스는 `ipcRenderer` 모듈의 `channel` +임의의 인수를 보낼 수도 있습니다. 렌더러 프로세스는 `ipcRenderer` 모듈의 `channel` 이벤트로 이 메시지를 받아 처리할 수 있습니다. 예시는 [webContents.send](web-contents.md#webcontentssendchannel-args)를 참고하세요. diff --git a/docs-translations/ko-KR/api/window-open.md b/docs-translations/ko-KR/api/window-open.md index 259b08dc5966..ac291283f546 100644 --- a/docs-translations/ko-KR/api/window-open.md +++ b/docs-translations/ko-KR/api/window-open.md @@ -11,7 +11,7 @@ 합니다. 새롭게 생성된 `BrowserWindow`는 기본적으로 부모 창의 옵션을 상속합니다. 이 옵션을 -변경하려면 새 창을 열 때 `features` 인자를 지정해야 합니다. +변경하려면 새 창을 열 때 `features` 인수를 지정해야 합니다. ### `window.open(url[, frameName][, features])` diff --git a/docs-translations/ko-KR/development/build-instructions-windows.md b/docs-translations/ko-KR/development/build-instructions-windows.md index 7d30635a6a04..e3804a410d36 100644 --- a/docs-translations/ko-KR/development/build-instructions-windows.md +++ b/docs-translations/ko-KR/development/build-instructions-windows.md @@ -61,7 +61,7 @@ $ python script\build.py -c D ## 64비트 빌드 64비트를 타겟으로 빌드 하려면 부트스트랩 스크립트를 실행할 때 `--target_arch=x64` -인자를 같이 넘겨주면 됩니다: +인수를 같이 넘겨주면 됩니다: ```powershell $ python script\bootstrap.py -v --target_arch=x64 diff --git a/docs-translations/ko-KR/development/debug-instructions-windows.md b/docs-translations/ko-KR/development/debug-instructions-windows.md index a0d50e475c76..35c49bc7e709 100644 --- a/docs-translations/ko-KR/development/debug-instructions-windows.md +++ b/docs-translations/ko-KR/development/debug-instructions-windows.md @@ -21,13 +21,13 @@ Electron 소스 코드가 중단점을 통해 순차적으로 쉽게 디버깅 설정해야 합니다. 이 작업은 Visual Studio가 Electron에서 무슨일이 일어나는지 더 잘 이해할 수 있도록 하며 변수를 사람이 읽기 좋은 포맷으로 쉽게 표현할 수 있도록 합니다. -* **ProcMon**: 이 무료 [SysInternals][sys-internals] 툴은 프로세스 인자, 파일 +* **ProcMon**: 이 무료 [SysInternals][sys-internals] 툴은 프로세스 인수, 파일 핸들러 그리고 레지스트리 작업을 탐색할 수 있게 도와줍니다. ## Electron에 디버거 연결하고 디버깅하기 디버깅 작업을 시작하려면, PowerShell/CMD 중 한 가지를 열고 디버그 빌드 상태의 -Electron에 인자로 어플리케이션을 전달하여 실행합니다: +Electron에 인수로 어플리케이션을 전달하여 실행합니다: ```powershell $ ./out/D/electron.exe ~/my-electron-app/ diff --git a/docs-translations/ko-KR/tutorial/desktop-environment-integration.md b/docs-translations/ko-KR/tutorial/desktop-environment-integration.md index 961bfc83076f..44cc66352425 100644 --- a/docs-translations/ko-KR/tutorial/desktop-environment-integration.md +++ b/docs-translations/ko-KR/tutorial/desktop-environment-integration.md @@ -90,7 +90,7 @@ app.clearRecentDocuments(); 않습니다. 어플리케이션 등록에 관련된 API의 모든 내용은 [Application Registration][app-registration]에서 찾아볼 수 있습니다. -유저가 JumpList에서 파일을 클릭할 경우 클릭된 파일의 경로가 커맨드 라인 인자로 추가되어 +유저가 JumpList에서 파일을 클릭할 경우 클릭된 파일의 경로가 커맨드 라인 인수로 추가되어 새로운 인스턴스의 어플리케이션이 실행됩니다. ### OS X에서 주의할 점 @@ -149,7 +149,7 @@ __Internet Explorer의 작업:__ ![IE](http://i.msdn.microsoft.com/dynimg/IC420539.png) OS X의 dock menu(진짜 메뉴)와는 달리 Windows의 사용자 작업은 어플리케이션 바로 -가기처럼 작동합니다. 유저가 작업을 클릭할 때 설정한 인자와 함께 새로운 어플리케이션이 +가기처럼 작동합니다. 유저가 작업을 클릭할 때 설정한 인수와 함께 새로운 어플리케이션이 실행됩니다. 사용자 작업을 설정하려면 [app.setUserTasks][setusertaskstasks] 메서드를 통해 구현할 @@ -168,7 +168,7 @@ app.setUserTasks([ ]); ``` -작업 리스트를 비우려면 간단히 `app.setUserTasks` 메서드의 첫번째 인자에 빈 배열을 넣어 +작업 리스트를 비우려면 간단히 `app.setUserTasks` 메서드의 첫번째 인수에 빈 배열을 넣어 호출하면 됩니다: ```javascript From 897d3769789d5f2fadd4fc7bd1bace9917248772 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Mon, 9 May 2016 16:20:05 +0900 Subject: [PATCH 3/7] :memo: Update Korean docs as upstream [ci skip] --- docs-translations/ko-KR/README.md | 1 + docs-translations/ko-KR/api/app.md | 43 ++++++++++-- docs-translations/ko-KR/api/browser-window.md | 6 ++ docs-translations/ko-KR/api/process.md | 3 + docs-translations/ko-KR/api/protocol.md | 15 +++-- docs-translations/ko-KR/api/web-contents.md | 65 ++++++++++++++++--- docs-translations/ko-KR/faq/electron-faq.md | 15 +++-- docs-translations/ko-KR/styleguide.md | 2 +- 8 files changed, 124 insertions(+), 26 deletions(-) diff --git a/docs-translations/ko-KR/README.md b/docs-translations/ko-KR/README.md index 63c8716e4fca..629c3ec8c210 100644 --- a/docs-translations/ko-KR/README.md +++ b/docs-translations/ko-KR/README.md @@ -20,6 +20,7 @@ Electron에 대해 자주 묻는 질문이 있습니다. 이슈를 생성하기 ## 개발 가이드 * [지원하는 플랫폼](tutorial/supported-platforms.md) +* [보안](tutorial/security.md) * [어플리케이션 배포](tutorial/application-distribution.md) * [Mac 앱스토어 어플리케이션 제출 가이드](tutorial/mac-app-store-submission-guide.md) * [어플리케이션 패키징](tutorial/application-packaging.md) diff --git a/docs-translations/ko-KR/api/app.md b/docs-translations/ko-KR/api/app.md index 1d6140435e7d..a64245688780 100644 --- a/docs-translations/ko-KR/api/app.md +++ b/docs-translations/ko-KR/api/app.md @@ -114,8 +114,26 @@ Returns: * `event` Event * `hasVisibleWindows` Boolean -어플리케이션이 활성화 되었을 때 발생하는 이벤트 입니다. -이 이벤트는 어플리케이션의 dock 아이콘을 클릭했을 때 주로 발생합니다. +어플리케이션이 활성화 되었을 때 발생하는 이벤트 입니다. 이 이벤트는 사용자가 +어플리케이션의 dock 아이콘을 클릭했을 때 주로 발생합니다. + +### Event: 'continue-activity' _OS X_ + +Returns: + +* `event` Event +* `type` String - Activity를 식별하는 문자열. + [`NSUserActivity.activityType`][activity-type]을 맵핑합니다. +* `userInfo` Object - 다른 기기의 activity에서 저장된 앱-특정 상태를 포함합니다. + +다른 기기에서 받아온 activity를 재개하려고 할 때 [Handoff][handoff] 하는 동안 +발생하는 이벤트입니다. 이 이벤트를 처리하려면 반드시 `event.preventDefault()`를 +호출해야 합니다. + +사용자 activity는 activity의 소스 어플리케이션과 같은 개발자 팀 ID를 가지는 +어플리케이션 안에서만 재개될 수 있고, activity의 타입을 지원합니다. 지원하는 +activity의 타입은 어플리케이션 `Info.plist`의 `NSUserActivityTypes` 키에 열거되어 +있습니다. ### Event: 'browser-window-blur' @@ -383,15 +401,13 @@ npm 모듈 규칙에 따라 대부분의 경우 `package.json`의 `name` 필드 이 API는 내부적으로 Windows 레지스트리와 LSSetDefaultHandlerForURLScheme를 사용합니다. -### `app.removeAsDefaultProtocolClient(protocol)` _Windows_ +### `app.removeAsDefaultProtocolClient(protocol)` _OS X_ _Windows_ * `protocol` String - 프로토콜의 이름, `://` 제외. 이 메서드는 현재 실행파일이 지정한 프로토콜(URI scheme)에 대해 기본 핸들러인지를 확인합니다. 만약 그렇다면, 이 메서드는 앱을 기본 핸들러에서 제거합니다. -**참고:** OS X에서는 앱을 제거하면 자동으로 기본 프로토콜 핸들러에서 제거됩니다. - ### `app.isDefaultProtocolClient(protocol)` _OS X_ _Windows_ * `protocol` String - `://`를 제외한 프로토콜의 이름. @@ -418,7 +434,7 @@ Windows에서 사용할 수 있는 JumpList의 [Tasks][tasks] 카테고리에 `t `Task` Object: * `program` String - 실행할 프로그램의 경로. 보통 현재 작동중인 어플리케이션의 경로인 `process.execPath`를 지정합니다. -* `arguments` String - `program`이 실행될 때 사용될 명령줄 인자. +* `arguments` String - `program`이 실행될 때 사용될 명령줄 인수. * `title` String - JumpList에 표시할 문자열. * `description` String - 이 작업에 대한 설명. * `iconPath` String - JumpList에 표시될 아이콘의 절대 경로. @@ -491,6 +507,19 @@ app.on('ready', function() { }); ``` +### `app.setUserActivity(type, userInfo)` _OS X_ + +* `type` String - 고유하게 activity를 식별합니다. + [`NSUserActivity.activityType`][activity-type]을 맵핑합니다. +* `userInfo` Object - 다른 기기에서 사용하기 위해 저장할 앱-특정 상태. + +`NSUserActivity`를 만들고 현재 activity에 설정합니다. 이 activity는 이후 다른 기기와 +[Handoff][handoff]할 때 자격으로 사용됩니다. + +### `app.getCurrentActivityType()` _OS X_ + +현재 작동중인 activity의 타입을 반환합니다. + ### `app.setAppUserModelId(id)` _Windows_ * `id` String @@ -577,3 +606,5 @@ dock 아이콘의 `image`를 설정합니다. [app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx [CFBundleURLTypes]: https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-102207-TPXREF115 [LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/library/mac/documentation/Carbon/Reference/LaunchServicesReference/#//apple_ref/c/func/LSCopyDefaultHandlerForURLScheme +[handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html +[activity-type]: https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSUserActivity_Class/index.html#//apple_ref/occ/instp/NSUserActivity/activityType diff --git a/docs-translations/ko-KR/api/browser-window.md b/docs-translations/ko-KR/api/browser-window.md index 76257c8463b7..23f1c26ba752 100644 --- a/docs-translations/ko-KR/api/browser-window.md +++ b/docs-translations/ko-KR/api/browser-window.md @@ -97,6 +97,10 @@ win.show(); * `webPreferences` Object - 웹 페이지 기능을 설정합니다. 사용할 수 있는 속성은 아래를 참고하세요. +`minWidth`/`maxWidth`/`minHeight`/`maxHeight`를 통해 최소 또는 최대 윈도우 크기를 +지정한 경우, 이는 사용자만을 제약하며, `setBounds`/`setSize` 또는 `BrowserWindow`의 +생성자에서 크기 제약을 따르지 않는 윈도우 크기를 전달하는 것은 막을 수 없습니다. + `type` 속성에서 사용할 수 있는 값과 동작은 다음과 같으며, 플랫폼에 따라 다릅니다: * Linux의 경우, `desktop`, `dock`, `toolbar`, `splash`, `notification` 종류를 @@ -161,6 +165,8 @@ win.show(); 활성화합니다. 기본값은 `false`입니다. * `directWrite` Boolean - Windows에서 폰트 렌더링을 위해 DirectWrite를 사용하는지를 지정합니다. 기본값은 `true`입니다. +* `scrollBounce` Boolean - OS X에서 스크롤 튕기기 효과 (탄성 밴딩)를 활성화 합니다. + 기본값은 `false`입니다. * `blinkFeatures` String - `CSSVariables,KeyboardEventKey`같은 `,`로 구분된 기능 문자열들의 리스트입니다. 지원하는 전체 기능 문자열들은 [setFeatureEnabledFromString][blink-feature-string] 함수에서 찾을 수 있습니다. diff --git a/docs-translations/ko-KR/api/process.md b/docs-translations/ko-KR/api/process.md index 9d5d6d88ab37..bf2a314c72a4 100644 --- a/docs-translations/ko-KR/api/process.md +++ b/docs-translations/ko-KR/api/process.md @@ -13,6 +13,9 @@ Electron의 `process` 객체는 기존의 node와는 달리 약간의 차이점 빌드일 땐 `undefined`로 지정됩니다. * `process.windowsStore` Boolean - 만약 앱이 Windows Store 앱 (appx)으로 작동하고 있다면, 이 값이 `true`로 지정되며 다른 빌드인 경우엔 `undefined`로 지정됩니다. +* `process.defaultApp` Boolean - 어플리케이션이 기본 어플리케이션 형식으로 전달되는 + 인수와 함께 실행됐을 때, 메인 프로세스에서 이 값이 `true`가 되며 다른 경우엔 + `undefined`가 됩니다. ## Events diff --git a/docs-translations/ko-KR/api/protocol.md b/docs-translations/ko-KR/api/protocol.md index 40ee6f192dd7..8c3e2c2934ac 100644 --- a/docs-translations/ko-KR/api/protocol.md +++ b/docs-translations/ko-KR/api/protocol.md @@ -6,11 +6,10 @@ ```javascript const electron = require('electron'); -const app = electron.app; +const { app, protocol } = electron; const path = require('path'); app.on('ready', function() { - var protocol = electron.protocol; protocol.registerFileProtocol('atom', function(request, callback) { var url = request.url.substr(7); callback({path: path.normalize(__dirname + '/' + url)}); @@ -21,7 +20,8 @@ app.on('ready', function() { }); ``` -**참고:** 이 모듈은 `app` 모듈의 `ready` 이벤트가 발생한 이후에만 사용할 수 있습니다. +**참고:** 모든 메서드는 따로 표기하지 않는 한 `app` 모듈의 `ready` 이벤트가 발생한 +이후에만 사용할 수 있습니다. ## Methods @@ -32,11 +32,16 @@ app.on('ready', function() { * `schemes` Array - 표준 스킴으로 등록할 커스텀 스킴 리스트 표준 `scheme`의 형식은 RFC 3986 [일반 URI 구문](https://tools.ietf.org/html/rfc3986#section-3) -표준을 따릅니다. 이 형식은 `file:`과 `filesystem:`을 포함합니다. +표준을 따릅니다. 이 형식은 `file:`, `filesystem:`, `http` 등을 포함합니다. 스킴을 +표준을 따라 등록하면, 스킴이 제공될 때 상대, 절대 경로의 리소스를 올바르게 취할 수 +있습니다. + +**참고:** 이 메서드는 `app` 모듈의 `ready` 이벤트가 발생하기 이전에만 사용할 수 +있습니다. ### `protocol.registerServiceWorkerSchemes(schemes)` -* `schemes` Array - 등록될 서비스 워커를 조작할 커스텀 스키마 +* `schemes` Array - 서비스 워커를 제어하기 위해 등록될 커스텀 스킴. ### `protocol.registerFileProtocol(scheme, handler[, completion])` diff --git a/docs-translations/ko-KR/api/web-contents.md b/docs-translations/ko-KR/api/web-contents.md index f3df544cf3c1..7962b4e439b7 100644 --- a/docs-translations/ko-KR/api/web-contents.md +++ b/docs-translations/ko-KR/api/web-contents.md @@ -38,7 +38,8 @@ Returns: 이 이벤트는 `did-finish-load`와 비슷하나, 로드가 실패했거나 취소되었을 때 발생합니다. 예를 들면 `window.stop()`이 실행되었을 때 발생합니다. 발생할 수 있는 전체 에러 코드의 목록과 설명은 [여기](https://code.google.com/p/chromium/codesearch#chromium/src/net/base/net_error_list.h)서 -확인할 수 있습니다. +확인할 수 있습니다. 참고로 리다이렉트 응답은 `errorCode` -3과 함께 발생합니다; 이 +에러는 명시적으로 무시할 수 있습니다. ### Event: 'did-frame-finish-load' @@ -292,7 +293,7 @@ Returns: * `image` NativeImage (optional) * `scale` Float (optional) -커서 타입이 변경될 때 발생하는 이벤트입니다. `type` 매개변수는 다음 값이 될 수 있습니다: +커서 타입이 변경될 때 발생하는 이벤트입니다. `type` 인수는 다음 값이 될 수 있습니다: `default`, `crosshair`, `pointer`, `text`, `wait`, `help`, `e-resize`, `n-resize`, `ne-resize`, `nw-resize`, `s-resize`, `se-resize`, `sw-resize`, `w-resize`, `ns-resize`, `ew-resize`, `nesw-resize`, `nwse-resize`, `col-resize`, @@ -301,10 +302,59 @@ Returns: `cell`, `context-menu`, `alias`, `progress`, `nodrop`, `copy`, `none`, `not-allowed`, `zoom-in`, `zoom-out`, `grab`, `grabbing`, `custom`. -만약 `type` 매개변수가 `custom` 이고 `image` 매개변수가 `NativeImage`를 통한 커스텀 -커서를 지정했을 때, 해당 이미지로 커서가 변경됩니다. 또한 `scale` 매개변수는 이미지의 +만약 `type` 인수가 `custom` 이고 `image` 인수가 `NativeImage`를 통한 커스텀 +커서를 지정했을 때, 해당 이미지로 커서가 변경됩니다. 또한 `scale` 인수는 이미지의 크기를 조정합니다. +### Event: 'context-menu' + +Returns: + +* `event` Event +* `params` Object + * `x` Integer - x 좌표 + * `y` Integer - y 좌표 + * `linkURL` String - 컨텍스트 메뉴가 호출된 노드를 둘러싸는 링크의 URL. + * `linkText` String - 링크에 연관된 텍스트. 콘텐츠의 링크가 이미지인 경우 빈 + 문자열이 됩니다. + * `pageURL` String - 컨텍스트 메뉴가 호출된 상위 수준 페이지의 URL. + * `frameURL` String - 컨텍스트 메뉴가 호출된 서브 프레임의 URL. + * `srcURL` String - 컨텍스트 메뉴가 호출된 요소에 대한 소스 URL. 요소와 소스 URL은 + 이미지, 오디오, 비디오입니다. + * `mediaType` String - 컨텍스트 메뉴가 호출된 노드의 타입. 값은 `none`, `image`, + `audio`, `video`, `canvas`, `file` 또는 `plugin`이 될 수 있습니다. + * `mediaFlags` Object - 컨텍스트 메뉴가 호출된 미디어 요소에 대한 인수들. + * `inError` - Boolean + * `isPaused` - Boolean + * `isMuted` - Boolean + * `hasAudio` - Boolean + * `isLooping` - Boolean + * `isControlsVisible` - Boolean + * `canToggleControls` - Boolean + * `canRotate` - Boolean + * `hasImageContent` Boolean - 컨텍스트 메뉴가 내용이 있는 이미지에서 호출되었는지 + 여부. + * `isEditable` Boolean - 컨텍스트를 편집할 수 있는지 여부. + * `editFlags` Object - 이 플래그는 랜더러가 다음 행동을 취할 수 있는지 여부를 + 표시합니다. + * `canUndo` - Boolean + * `canRedo` - Boolean + * `canCut` - Boolean + * `canCopy` - Boolean + * `canPaste` - Boolean + * `canDelete` - Boolean + * `canSelectAll` - Boolean + * `selectionText` String - 컨텍스트 메뉴가 호출된 부분에 있는 선택된 텍스트. + * `titleText` String - 컨텍스트 메뉴가 호출된 선택된 제목 또는 알림 텍스트. + * `misspelledWord` String - 만약 있는 경우, 커서가 가르키는 곳에서 발생한 오타. + * `frameCharset` String - 메뉴가 호출된 프레임의 문자열 인코딩. + * `inputFieldType` String - 컨텍스트 메뉴가 입력 필드에서 호출되었을 때, 그 필드의 + 타입. 값은 `none`, `plainText`, `password`, `other` 중 한 가지가 될 수 있습니다. + * `menuSourceType` String - 컨텍스트 메뉴를 호출한 입력 소스. 값은 `none`, + `mouse`, `keyboard`, `touch`, `touchMenu` 중 한 가지가 될 수 있습니다. + +새로운 컨텍스트 메뉴의 제어가 필요할 때 발생하는 이벤트입니다. + ## Instance Methods `webContents`객체는 다음과 같은 인스턴스 메서드들을 가지고 있습니다. @@ -576,7 +626,7 @@ print기능을 사용하지 않는 경우 전체 바이너리 크기를 줄이 ### `webContents.printToPDF(options, callback)` * `options` Object - * `marginsType` Integer - 사용할 마진의 종류를 지정합니다. 0 부터 2 사이 값을 사용할 + * `marginsType` Integer - 사용할 마진의 타입을 지정합니다. 0 부터 2 사이 값을 사용할 수 있고 각각 기본 마진, 마진 없음, 최소 마진입니다. * `pageSize` String - 생성되는 PDF의 페이지 크기를 지정합니다. 값은 `A3`, `A4`, `A5`, `Legal`, `Letter` 와 `Tabloid`가 사용될 수 있습니다. @@ -898,7 +948,7 @@ win.webContents.debugger.sendCommand("Network.enable"); * `method` String - 메서드 이름, 반드시 원격 디버깅 프로토콜에 의해 정의된 메서드중 하나가 됩니다. -* `commandParams` Object (optional) - 요청 매개변수를 표현한 JSON 객체. +* `commandParams` Object (optional) - 요청 인수를 표현한 JSON 객체. * `callback` Function (optional) - 응답 * `error` Object - 커맨드의 실패를 표시하는 에러 메시지. * `result` Object - 원격 디버깅 프로토콜에서 커맨드 설명의 'returns' 속성에 의해 @@ -918,8 +968,7 @@ win.webContents.debugger.sendCommand("Network.enable"); * `event` Event * `method` String - 메서드 이름. -* `params` Object - 원격 디버깅 프로토콜의 'parameters' 속성에서 정의된 이벤트 - 매개변수 +* `params` Object - 원격 디버깅 프로토콜의 'parameters' 속성에서 정의된 이벤트 인수 디버깅 타겟이 관련 이벤트를 발생시킬 때 마다 발생하는 이벤트입니다. diff --git a/docs-translations/ko-KR/faq/electron-faq.md b/docs-translations/ko-KR/faq/electron-faq.md index a038142c5ae3..ae77335b0008 100644 --- a/docs-translations/ko-KR/faq/electron-faq.md +++ b/docs-translations/ko-KR/faq/electron-faq.md @@ -3,16 +3,19 @@ ## 언제 Electron이 최신 버전의 Chrome으로 업그레이드 되나요? Electron의 Chrome 버전은 보통 새로운 Chrome 안정 버전이 릴리즈 된 이후 1주 내지 2주 -내로 업데이트됩니다. +내로 업데이트됩니다. 하지만 이러한 업데이트 주기는 보장되지 않으며 업그레이드에 필요한 +작업의 양에 따라 달라집니다. -또한 우리는 크롬의 안정된 채널만을 이용합니다, 만약 중요한 수정이 베타 또는 개발 채널인 -경우, 우리는 해당 버전 대신 이전 버전을 다시 사용합니다. +Electron은 크롬이 사용하는 안정된 채널만을 이용합니다, 만약 중요한 수정이 베타 또는 +개발 채널에 패치된 경우, 이전 버전의 채널로 롤백합니다. + +자세한 내용은 [보안 설명](../tutorial/electron-security.md)을 참고하세요. ## Electron은 언제 최신 버전의 Node.js로 업그레이드 하나요? -새로운 버전의 Node.js가 릴리즈 되면, 우리는 보통 Electron을 업그레이드 하기 전에 한 -달 정도 대기합니다. 이렇게 하면 새로운 Node.js 버전을 업데이트 함으로써 발생하는 -버그들을 피할 수 있습니다. 이러한 상황은 자주 발생합니다. +새로운 버전의 Node.js가 릴리즈 되면, 보통 Electron을 업그레이드 하기 전에 한 달 정도 +대기합니다. 이렇게 하면 새로운 Node.js 버전을 업데이트 함으로써 발생하는 버그들을 +피할 수 있기 때문입니다. 이러한 상황은 자주 발생합니다. Node.js의 새로운 기능은 보통 V8 업그레이드에서 가져옵니다. Electron은 Chrome 브라우저에 탑재된 V8을 사용하고 있습니다. 눈부신 새로운 Node.js 버전의 자바스크립트 diff --git a/docs-translations/ko-KR/styleguide.md b/docs-translations/ko-KR/styleguide.md index 3896f3d21d10..bf9eba1ee2d6 100644 --- a/docs-translations/ko-KR/styleguide.md +++ b/docs-translations/ko-KR/styleguide.md @@ -92,7 +92,7 @@ Returns: 다음과 같이 사용할 수 있습니다: ```javascript -Alarm.on('wake-up', function(time) { +Alarm.on('wake-up', (time) => { console.log(time) }) ``` From 60d7dd991d580ea57aa3a46902dcf9a30e0b1d7e Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Mon, 9 May 2016 16:23:11 +0900 Subject: [PATCH 4/7] :memo: Fix small typos [ci skip] --- docs-translations/ko-KR/api/app.md | 14 +++++++------- docs-translations/ko-KR/api/browser-window.md | 2 +- docs-translations/ko-KR/api/web-contents.md | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs-translations/ko-KR/api/app.md b/docs-translations/ko-KR/api/app.md index a64245688780..2df0c760c4d4 100644 --- a/docs-translations/ko-KR/api/app.md +++ b/docs-translations/ko-KR/api/app.md @@ -41,7 +41,7 @@ Electron은 먼저 모든 윈도우의 종료를 시도하고 `will-quit` 이벤 않습니다. **역주:** 이 이벤트는 말 그대로 현재 어플리케이션에서 윈도우만 완전히 종료됬을 때 -발생하는 이벤트 입니다. 따라서 어플리케이션을 완전히 종료하려면 이 이벤트에서 +발생하는 이벤트입니다. 따라서 어플리케이션을 완전히 종료하려면 이 이벤트에서 `app.quit()`를 호출해 주어야 합니다. ### Event: 'before-quit' @@ -60,7 +60,7 @@ Returns: * `event` Event -모든 윈도우들이 종료되고 어플리케이션이 종료되기 시작할 때 발생하는 이벤트 입니다. +모든 윈도우들이 종료되고 어플리케이션이 종료되기 시작할 때 발생하는 이벤트입니다. `event.preventDefault()` 호출을 통해 어플리케이션의 종료를 방지할 수 있습니다. `will-quit` 와 `window-all-closed` 이벤트의 차이점을 확인하려면 `window-all-close` @@ -114,7 +114,7 @@ Returns: * `event` Event * `hasVisibleWindows` Boolean -어플리케이션이 활성화 되었을 때 발생하는 이벤트 입니다. 이 이벤트는 사용자가 +어플리케이션이 활성화 되었을 때 발생하는 이벤트입니다. 이 이벤트는 사용자가 어플리케이션의 dock 아이콘을 클릭했을 때 주로 발생합니다. ### Event: 'continue-activity' _OS X_ @@ -142,7 +142,7 @@ Returns: * `event` Event * `window` BrowserWindow -[browserWindow](browser-window.md)에 대한 포커스가 사라졌을 때 발생하는 이벤트 입니다. +[browserWindow](browser-window.md)에 대한 포커스가 사라졌을 때 발생하는 이벤트입니다. ### Event: 'browser-window-focus' @@ -151,7 +151,7 @@ Returns: * `event` Event * `window` BrowserWindow -[browserWindow](browser-window.md)에 대한 포커스가 발생했을 때 발생하는 이벤트 입니다. +[browserWindow](browser-window.md)에 대한 포커스가 발생했을 때 발생하는 이벤트입니다. **역주:** _포커스_ 는 창을 클릭해서 활성화 시켰을 때를 말합니다. @@ -162,7 +162,7 @@ Returns: * `event` Event * `window` BrowserWindow -새로운 [browserWindow](browser-window.md)가 생성되었을 때 발생하는 이벤트 입니다. +새로운 [browserWindow](browser-window.md)가 생성되었을 때 발생하는 이벤트입니다. ### Event: 'certificate-error' @@ -205,7 +205,7 @@ Returns: * `issuerName` String - 발급자의 공통 이름 * `callback` Function -클라이언트 인증이 요청되었을 때 발생하는 이벤트 입니다. +클라이언트 인증이 요청되었을 때 발생하는 이벤트입니다. `url`은 클라이언트 인증서를 요청하는 탐색 항목에 해당합니다. 그리고 `callback`은 목록에서 필터링된 항목과 함께 호출될 필요가 있습니다. diff --git a/docs-translations/ko-KR/api/browser-window.md b/docs-translations/ko-KR/api/browser-window.md index 23f1c26ba752..7cb53df4c959 100644 --- a/docs-translations/ko-KR/api/browser-window.md +++ b/docs-translations/ko-KR/api/browser-window.md @@ -194,7 +194,7 @@ Returns: * `event` Event -문서의 제목이 변경될 때 발생하는 이벤트 입니다. `event.preventDefault()`를 호출하여 +문서의 제목이 변경될 때 발생하는 이벤트입니다. `event.preventDefault()`를 호출하여 네이티브 윈도우의 제목이 변경되는 것을 방지할 수 있습니다. ### Event: 'close' diff --git a/docs-translations/ko-KR/api/web-contents.md b/docs-translations/ko-KR/api/web-contents.md index 7962b4e439b7..079141c10252 100644 --- a/docs-translations/ko-KR/api/web-contents.md +++ b/docs-translations/ko-KR/api/web-contents.md @@ -226,7 +226,7 @@ Returns: * `issuerName` String - 인증서 발급자 이름 * `callback` Function -클라이언트 인증이 요청되었을 때 발생하는 이벤트 입니다. +클라이언트 인증이 요청되었을 때 발생하는 이벤트입니다. 사용법은 [`app`의 `select-client-certificate` 이벤트](app.md#event-select-client-certificate)와 같습니다. From 12e62746b383ca4f51cea2c32611128d96f4f282 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Tue, 10 May 2016 13:48:26 +0900 Subject: [PATCH 5/7] :memo: Add `security.md` [ci skip] --- docs-translations/ko-KR/tutorial/security.md | 70 ++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 docs-translations/ko-KR/tutorial/security.md diff --git a/docs-translations/ko-KR/tutorial/security.md b/docs-translations/ko-KR/tutorial/security.md new file mode 100644 index 000000000000..2466efe65ac3 --- /dev/null +++ b/docs-translations/ko-KR/tutorial/security.md @@ -0,0 +1,70 @@ +# 보안, 네이티브 호환성, 그리고 신뢰성 + +웹 개발자로써, 우리는 일반적으로 브라우저의 강력한 웹 보안을 잘 이용해왔습니다 - 작성한 +코드에 관련된 보안 문제는 아주 적었습니다. 웹 사이트에 대해 상당히 제한된 권한과 기능에 +의존해왔습니다 - 그리고 사용자들이 새로운 보안 위협에 대해 발 빠르게 대응할 수 있는 +아주 커다란 팀의 엔지니어들에 의해 만들어진 브라우저를 마음 놓고 즐길 것이라고 +믿어왔습니다. + +하지만 Electron을 사용하여 작업한다면, Electron은 웹 브라우저가 아니라는 것을 이해하는 +것이 중요합니다. Electron은 웹 기술을 사용하여 강력한 데스크톱 어플리케이션을 만들 수 +있도록 해줍니다. 가장 핵심 기능은 바로 제한된 웹 사이트의 기능을 커버할 정도로 완전한 +네이티브 어플리케이션과 동일한 기능을 하는 강력한 소프트웨어를 만들 수 있는 능력입니다. +하지만 코드에 부여된 추가적인 기능만큼 고유한 보안 문제가 발생할 수 있습니다. + +이를 염두해두고, 신뢰할 수 없는 출처의 임의의 콘텐츠를 표시할 때 Electron에서 +자체적으로 처리하지 않는 심각한 보안 문제를 야기할 수 있다는 점을 주의해야 합니다. +실제로도, 가장 유명한 Electron 어플리케이션들은 (Atom, Slack, Visual Studio Code, +등) 주로 로컬 콘텐츠를 (또는 Node 통합이 제외된 신뢰된, 보안된 원격 콘텐츠) 사용합니다 +- 만약 어플리케이션이 온라인 출처에서 가져온 코드를 실행한다면, 그 코드가 악성 코드가 +아닌지 판별하는 것은 본인의 책임입니다. + +## Chromium 보안 문제와 업그레이드 + +Electron이 새로운 버전의 Chromium을 가능한 한 빠르게 지원하려고 노력하지만, +개발자는 이러한 업그레이딩 작업은 매우 힘든 작업이라는 것을 알아야 합니다 - 각 관련된 +수십에서 심지어 백자리 개수의 파일들을 손수 수정해야 합니다. 주어진 자원과 현재 +기여도를 생각한다면, Electron은 항상 최신 버전의 Chromium을 유지하지 못할 수 있으며, +며칠부터 몇 주까지 더 걸릴 수 있습니다. + +현재 Chromium 구성 요소를 업데이트하는 시스템은 우리가 사용할 수 있는 자원과 이 +프레임워크를 기반으로 구축된 대부분의 어플리케이션이 요구하는 것 사이에서 적절한 균형을 +유지하고 있다고 느끼고 있습니다. 우리는 확실히 Electron 위에 무언가를 만드는 사람들의 +사용 사례에 대한 자세한 내용을 듣는 것에 관심이 있습니다. 이러한 노력을 지원하는 Pull +request와 기여는 언제나 환영합니다. + +## 위 조언 무시하기 + +원격 위치에서 받아온 코드를 로컬에서 실행하는 경우 언제나 보안 문제가 존재합니다. +예를 들어, 원격 웹 사이트가 브라우저 윈도우에서 표시될 때를 생각해볼 때, 만약 공격자가 +어떠한 방법으로 웹 페이지의 콘텐츠를 변경하는 경우 (소스를 직접적으로 공격하거나 +어플리케이션과 실질적인 위치 사이에서 공격하는 등), 공갹자는 사용자의 기기에서 네이티브 +코드를 실행할 수 있습니다. + +> :warning: 어떠한 상황에서도 원격 코드를 로드하고 실행할 땐 Node 통합 기능을 +비활성화하고, 로컬 파일만 (어플리케이션 패키지 내부에 포함된) Node 코드를 실행시킬 수 +있도록 하는 것이 좋습니다. 원격 콘텐츠를 표시할 땐, 항상 `webview`를 사용하고 +`nodeIntegration`이 비활성화되어있는지 확인하세요. + +#### 체크 리스트 + +이 리스트는 완벽하지 않습니다, 하지만 최소한 다음 사항은 확인하는 것이 좋습니다: + +* 보안된 (https) 콘텐츠만 표시합니다. +* 원격 콘텐츠를 표시하는 모든 렌더러에서 Node 통합 기능을 비활성화합니다. + (`webPreferences` 사용) +* `webSecurity`를 비활성화하지 않습니다. 이 옵션을 비활성화하면 동일-출처 정책도 + 비활성화됩니다. +* `allowDisplayingInsecureContent`를 `true`로 설정하지 마세요. +* `allowRunningInsecureContent`를 `true`로 설정하지 마세요. +* 무엇을 하고 있는지 확실히 알고 있지않는 이상 `experimentalFeatures` 또는 + `experimentalCanvasFeatures`를 활성화하지 마세요. +* 무엇을 하고 있는지 확실히 알고 있지않는 이상 `blinkFeatures`를 활성화하지 마세요. +* WebViews: `nodeintegration`를 `false`로 설정하세요. +* WebViews: `disablewebsecurity`를 사용하지 마세요. +* WebViews: `allowpopups`를 사용하지 마세요. +* WebViews: 원격 CSS/JS와 `insertCSS` 또는 `executeJavaScript`를 함께 사용하지 + 마세요. + +다시 말하지만, 이 리스트는 그저 위험을 최소화할 뿐이며 완전히 제거하지 않습니다. 만약 +목적이 그저 웹 사이트를 보여주는 것이라면 일반 웹 브라우저가 더 안전한 방법입니다. From 6bad16377decd93d4c376f7c2763826a664b1b5b Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Tue, 10 May 2016 16:27:14 +0900 Subject: [PATCH 6/7] :memo: Update Korean docs as upstream [ci skip] --- docs-translations/ko-KR/api/app.md | 12 ++-- docs-translations/ko-KR/api/browser-window.md | 10 +-- .../ko-KR/api/chrome-command-line-switches.md | 4 +- docs-translations/ko-KR/api/clipboard.md | 4 +- .../ko-KR/api/content-tracing.md | 6 +- docs-translations/ko-KR/api/crash-reporter.md | 2 +- .../ko-KR/api/desktop-capturer.md | 4 +- docs-translations/ko-KR/api/dialog.md | 4 +- docs-translations/ko-KR/api/download-item.md | 8 +-- docs-translations/ko-KR/api/file-object.md | 10 +-- .../ko-KR/api/frameless-window.md | 8 +-- .../ko-KR/api/global-shortcut.md | 9 ++- docs-translations/ko-KR/api/ipc-main.md | 10 +-- docs-translations/ko-KR/api/menu.md | 37 ++++++----- docs-translations/ko-KR/api/native-image.md | 8 +-- docs-translations/ko-KR/api/power-monitor.md | 4 +- .../ko-KR/api/power-save-blocker.md | 4 +- docs-translations/ko-KR/api/process.md | 4 +- docs-translations/ko-KR/api/protocol.md | 58 ++++++++++++------ docs-translations/ko-KR/api/remote.md | 41 ++++++------- docs-translations/ko-KR/api/screen.md | 27 ++++---- docs-translations/ko-KR/api/session.md | 32 +++++----- docs-translations/ko-KR/api/shell.md | 3 +- docs-translations/ko-KR/api/synopsis.md | 33 ++++++---- .../ko-KR/api/system-preferences.md | 2 +- docs-translations/ko-KR/api/tray.md | 12 ++-- docs-translations/ko-KR/api/web-contents.md | 61 ++++++++++--------- docs-translations/ko-KR/api/web-frame.md | 2 +- docs-translations/ko-KR/api/web-view-tag.md | 38 ++++++------ docs-translations/ko-KR/faq/electron-faq.md | 10 +-- .../ko-KR/tutorial/application-packaging.md | 8 +-- .../desktop-environment-integration.md | 21 ++++--- .../ko-KR/tutorial/online-offline-events.md | 20 +++--- .../ko-KR/tutorial/quick-start.md | 35 ++++++----- .../tutorial/using-pepper-flash-plugin.md | 4 +- .../tutorial/using-selenium-and-webdriver.md | 42 ++++++------- .../tutorial/using-widevine-cdm-plugin.md | 4 +- 37 files changed, 314 insertions(+), 287 deletions(-) diff --git a/docs-translations/ko-KR/api/app.md b/docs-translations/ko-KR/api/app.md index 2df0c760c4d4..4b747d0b1b56 100644 --- a/docs-translations/ko-KR/api/app.md +++ b/docs-translations/ko-KR/api/app.md @@ -5,8 +5,8 @@ 밑의 예시는 마지막 윈도우가 종료되었을 때, 어플리케이션을 종료시키는 예시입니다: ```javascript -const app = require('electron').app; -app.on('window-all-closed', function() { +const { app } = require('electron'); +app.on('window-all-closed', () => { app.quit(); }); ``` @@ -244,7 +244,7 @@ Returns: `callback(username, password)` 형태의 콜백을 호출하여 인증을 처리해야 합니다. ```javascript -app.on('login', function(event, webContents, request, authInfo, callback) { +app.on('login', (event, webContents, request, authInfo, callback) => { event.preventDefault(); callback('username', 'secret'); }) @@ -486,9 +486,9 @@ OS X에선 사용자가 Finder에서 어플리케이션의 두 번째 인스턴 인스턴스의 윈도우를 활성화 시키는 예시입니다: ```javascript -var myWindow = null; +let myWindow = null; -var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) { +const shouldQuit = app.makeSingleInstance((commandLine, workingDirectory) => { // 어플리케이션을 중복 실행했습니다. 주 어플리케이션 인스턴스를 활성화 합니다. if (myWindow) { if (myWindow.isMinimized()) myWindow.restore(); @@ -503,7 +503,7 @@ if (shouldQuit) { } // 윈도우를 생성하고 각종 리소스를 로드하고 작업합니다. -app.on('ready', function() { +app.on('ready', () => { }); ``` diff --git a/docs-translations/ko-KR/api/browser-window.md b/docs-translations/ko-KR/api/browser-window.md index 7cb53df4c959..321439f84930 100644 --- a/docs-translations/ko-KR/api/browser-window.md +++ b/docs-translations/ko-KR/api/browser-window.md @@ -6,13 +6,13 @@ ```javascript // 메인 프로세스에서 -const BrowserWindow = require('electron').BrowserWindow; +const { BrowserWindow } = require('electron'); // 또는 렌더러 프로세스에서 -const BrowserWindow = require('electron').remote.BrowserWindow; +const { BrowserWindow } = require('electron').remote; -var win = new BrowserWindow({ width: 800, height: 600, show: false }); -win.on('closed', function() { +let win = new BrowserWindow({ width: 800, height: 600, show: false }); +win.on('closed', () => { win = null; }); @@ -318,7 +318,7 @@ Returns: e.g. `APPCOMMAND_BROWSER_BACKWARD` 는 `browser-backward`와 같이 반환됩니다. ```javascript -someWindow.on('app-command', function(e, cmd) { +someWindow.on('app-command', (e, cmd) => { // 마우스의 뒤로가기 버튼을 눌렀을 때 뒤로가기 탐색을 실행합니다 if (cmd === 'browser-backward' && someWindow.webContents.canGoBack()) { someWindow.webContents.goBack(); diff --git a/docs-translations/ko-KR/api/chrome-command-line-switches.md b/docs-translations/ko-KR/api/chrome-command-line-switches.md index 7f1f4ced6166..1b5f672fa5a8 100644 --- a/docs-translations/ko-KR/api/chrome-command-line-switches.md +++ b/docs-translations/ko-KR/api/chrome-command-line-switches.md @@ -7,11 +7,11 @@ 명령줄 옵션을 추가로 지정할 수 있습니다: ```javascript -const app = require('electron').app; +const { app } = require('electron'); app.commandLine.appendSwitch('remote-debugging-port', '8315'); app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1'); -app.on('ready', function() { +app.on('ready', () => { // Your code here }); ``` diff --git a/docs-translations/ko-KR/api/clipboard.md b/docs-translations/ko-KR/api/clipboard.md index 0590713e83b3..8f48c6f579f0 100644 --- a/docs-translations/ko-KR/api/clipboard.md +++ b/docs-translations/ko-KR/api/clipboard.md @@ -2,8 +2,10 @@ > 시스템 클립보드에 복사와 붙여넣기를 수행합니다. +다음 예시는 클립보드에 문자열을 쓰는 방법을 보여줍니다: + ```javascript -const clipboard = require('electron').clipboard; +const { clipboard } = require('electron'); clipboard.writeText('Example String'); ``` diff --git a/docs-translations/ko-KR/api/content-tracing.md b/docs-translations/ko-KR/api/content-tracing.md index ac923ee9fe90..204ed20622d9 100644 --- a/docs-translations/ko-KR/api/content-tracing.md +++ b/docs-translations/ko-KR/api/content-tracing.md @@ -7,7 +7,7 @@ `chrome://tracing/` 페이지를 열고 생성된 파일을 로드하면 결과를 볼 수 있습니다. ```javascript -const contentTracing = require('electron').contentTracing; +const { contentTracing } = require('electron'); const options = { categoryFilter: '*', @@ -17,8 +17,8 @@ const options = { contentTracing.startRecording(options, function() { console.log('Tracing started'); - setTimeout(function() { - contentTracing.stopRecording('', function(path) { + setTimeout(() => { + contentTracing.stopRecording('', (path) => { console.log('Tracing data recorded to ' + path); }); }, 5000); diff --git a/docs-translations/ko-KR/api/crash-reporter.md b/docs-translations/ko-KR/api/crash-reporter.md index 90851f7ee5bd..f4e674132ab2 100644 --- a/docs-translations/ko-KR/api/crash-reporter.md +++ b/docs-translations/ko-KR/api/crash-reporter.md @@ -5,7 +5,7 @@ 다음 예시는 윈격 서버에 어플리케이션 크래시 정보를 자동으로 보고하는 예시입니다: ```javascript -const crashReporter = require('electron').crashReporter; +const { crashReporter } = require('electron'); crashReporter.start({ productName: 'YourName', diff --git a/docs-translations/ko-KR/api/desktop-capturer.md b/docs-translations/ko-KR/api/desktop-capturer.md index 0ee1b3e1d229..6135ca500d5b 100644 --- a/docs-translations/ko-KR/api/desktop-capturer.md +++ b/docs-translations/ko-KR/api/desktop-capturer.md @@ -5,9 +5,9 @@ ```javascript // 렌더러 프로세스 내부 -var desktopCapturer = require('electron').desktopCapturer; +const { desktopCapturer } = require('electron'); -desktopCapturer.getSources({types: ['window', 'screen']}, function(error, sources) { +desktopCapturer.getSources({types: ['window', 'screen']}, (error, sources) => { if (error) throw error; for (var i = 0; i < sources.length; ++i) { if (sources[i].name == "Electron") { diff --git a/docs-translations/ko-KR/api/dialog.md b/docs-translations/ko-KR/api/dialog.md index 2110e376c27c..7282f5888c88 100644 --- a/docs-translations/ko-KR/api/dialog.md +++ b/docs-translations/ko-KR/api/dialog.md @@ -6,7 +6,7 @@ ```javascript var win = ...; // 대화 상자를 사용할 BrowserWindow 객체 -const dialog = require('electron').dialog; +const { dialog } = require('electron'); console.log(dialog.showOpenDialog({ properties: [ 'openFile', 'openDirectory', 'multiSelections' ]})); ``` @@ -14,7 +14,7 @@ console.log(dialog.showOpenDialog({ properties: [ 'openFile', 'openDirectory', ' 객체를 사용하고 싶다면, `remote`를 통해 접근하는 방법을 고려해야 합니다: ```javascript -const dialog = require('electron').remote.dialog; +const { dialog } = require('electron').remote; ``` ## Methods diff --git a/docs-translations/ko-KR/api/download-item.md b/docs-translations/ko-KR/api/download-item.md index 4267a41df71d..4de29eb86076 100644 --- a/docs-translations/ko-KR/api/download-item.md +++ b/docs-translations/ko-KR/api/download-item.md @@ -8,17 +8,17 @@ ```javascript // 메인 프로세스 -win.webContents.session.on('will-download', function(event, item, webContents) { +win.webContents.session.on('will-download', (event, item, webContents) => { // Set the save path, making Electron not to prompt a save dialog. item.setSavePath('/tmp/save.pdf'); console.log(item.getMimeType()); console.log(item.getFilename()); console.log(item.getTotalBytes()); - item.on('updated', function() { + item.on('updated', () => { console.log('Received bytes: ' + item.getReceivedBytes()); }); - item.on('done', function(e, state) { - if (state == "completed") { + item.on('done', (e, state) => { + if (state === "completed") { console.log("Download successfully"); } else { console.log("Download is cancelled or interrupted that can't be resumed"); diff --git a/docs-translations/ko-KR/api/file-object.md b/docs-translations/ko-KR/api/file-object.md index 6d7519a7ad2c..898f7f75b82d 100644 --- a/docs-translations/ko-KR/api/file-object.md +++ b/docs-translations/ko-KR/api/file-object.md @@ -14,16 +14,16 @@ API를 사용하여 작업할 때 선택된 파일의 경로를 알 수 있도 @@ -50,15 +48,28 @@ app.on('ready', function() { ## 분리 할당 -만약 CoffeeScript나 Babel을 사용하고 있다면, 빌트인 모듈을 사용할 때 -[분리 할당][destructuring-assignment]을 통해 직관적으로 사용할 수 있습니다: +0.37 버전부터, [분리 할당][destructuring-assignment]을 통해 빌트인 모듈을 더 +직관적으로 사용할 수 있습니다: ```javascript -const {app, BrowserWindow} = require('electron') +const { app, BrowserWindow } = require('electron'); ``` -아직 플레인 자바스크립트를 쓰고 있다면, Chrome이 ES6를 완전히 지원하기 전까지 기다려야 -합니다. +모든 `electron` 모듈이 필요하다면, 먼저 require한 후 각 독립적인 모듈을 +`electron`에서 분리 할당함으로써 모듈을 사용할 수 있습니다. + +```javascript +const electron = require('electron'); +const { app, BrowserWindow } = electron; + ``` + +위 코드는 다음과 같습니다: + +```javascript +const electron = require('electron'); +const app = electron.app; +const BrowserWindow = electron.BrowserWindow; +``` ## 이전 스타일의 빌트인 모듈 비활성화 diff --git a/docs-translations/ko-KR/api/system-preferences.md b/docs-translations/ko-KR/api/system-preferences.md index c5707ea7eaf1..fa3996872d36 100644 --- a/docs-translations/ko-KR/api/system-preferences.md +++ b/docs-translations/ko-KR/api/system-preferences.md @@ -56,7 +56,7 @@ OS X에선 API가 `NSUserDefaults`를 읽어들입니다. 유명한 `key`와 `ty 예시입니다 (투명한 윈도우는 DWM 컴포지션이 비활성화되어있을 시 작동하지 않습니다): ```javascript -let browserOptions = {width: 1000, height: 800}; +let browserOptions = { width: 1000, height: 800 }; // 플랫폼이 지원하는 경우에만 투명 윈도우를 생성. if (process.platform !== 'win32' || systemPreferences.isAeroGlassEnabled()) { diff --git a/docs-translations/ko-KR/api/tray.md b/docs-translations/ko-KR/api/tray.md index 6162557e1a7c..6cfecd4be8d9 100644 --- a/docs-translations/ko-KR/api/tray.md +++ b/docs-translations/ko-KR/api/tray.md @@ -3,15 +3,12 @@ > 아이콘과 컨텍스트 메뉴를 시스템 알림 영역에 추가합니다. ```javascript -const electron = require('electron'); -const app = electron.app; -const Menu = electron.Menu; -const Tray = electron.Tray; +const { app, Menu, Tray } = require('electron'); -var appIcon = null; -app.on('ready', function(){ +let appIcon = null; +app.on('ready', () => { appIcon = new Tray('/path/to/my/icon'); // 현재 어플리케이션 디렉터리를 기준으로 하려면 `__dirname + '/images/tray.png'` 형식으로 입력해야 합니다. - var contextMenu = Menu.buildFromTemplate([ + const contextMenu = Menu.buildFromTemplate([ { label: 'Item1', type: 'radio' }, { label: 'Item2', type: 'radio' }, { label: 'Item3', type: 'radio', checked: true }, @@ -20,7 +17,6 @@ app.on('ready', function(){ appIcon.setToolTip('이것은 나의 어플리케이션 입니다!'); appIcon.setContextMenu(contextMenu); }); - ``` __플랫폼별 한계:__ diff --git a/docs-translations/ko-KR/api/web-contents.md b/docs-translations/ko-KR/api/web-contents.md index 079141c10252..ae7b6d2af0d7 100644 --- a/docs-translations/ko-KR/api/web-contents.md +++ b/docs-translations/ko-KR/api/web-contents.md @@ -8,12 +8,12 @@ 접근하는 예시입니다: ```javascript -const BrowserWindow = require('electron').BrowserWindow; +const { BrowserWindow } = require('electron'); -var win = new BrowserWindow({width: 800, height: 1500}); +let win = new BrowserWindow({width: 800, height: 1500}); win.loadURL("http://github.com"); -var webContents = win.webContents; +let webContents = win.webContents; ``` ## Events @@ -388,10 +388,10 @@ webContents.loadURL(url, options) 현재 웹 페이지의 URL을 반환합니다. ```javascript -var win = new BrowserWindow({width: 800, height: 600}); +let win = new BrowserWindow({width: 800, height: 600}); win.loadURL("http://github.com"); -var currentURL = win.webContents.getURL(); +let currentURL = win.webContents.getURL(); ``` ### `webContents.getTitle()` @@ -654,22 +654,22 @@ Chromium의 미리보기 프린팅 커스텀 설정을 이용하여 윈도우의 ``` ```javascript -const BrowserWindow = require('electron').BrowserWindow; +const { BrowserWindow } = require('electron'); const fs = require('fs'); -var win = new BrowserWindow({width: 800, height: 600}); -win.loadURL("http://github.com"); +let win = new BrowserWindow({width: 800, height: 600}); +win.loadURL('http://github.com'); -win.webContents.on("did-finish-load", function() { - // Use default printing options - win.webContents.printToPDF({}, function(error, data) { +win.webContents.on('did-finish-load', () => { + // 기본 프린트 옵션을 사용합니다 + win.webContents.printToPDF({}, (error, data) => { if (error) throw error; - fs.writeFile("/tmp/print.pdf", data, function(error) { + fs.writeFile('/tmp/print.pdf', data, (error) => { if (error) throw error; - console.log("Write PDF successfully."); - }) - }) + console.log('Write PDF successfully.'); + }); + }); }); ``` @@ -745,13 +745,14 @@ mainWindow.webContents.on('devtools-opened', function() { 메인 프로세스에서 렌더러 프로세스로 메시지를 보내는 예시 입니다: ```javascript -// In the main process. -var window = null; -app.on('ready', function() { - window = new BrowserWindow({width: 800, height: 600}); - window.loadURL('file://' + __dirname + '/index.html'); - window.webContents.on('did-finish-load', function() { - window.webContents.send('ping', 'whoooooooh!'); +// 메인 프로세스에서. +let mainWindow = null; + +app.on('ready', () => { + mainWindow = new BrowserWindow({width: 800, height: 600}); + mainWindow.loadURL(`file://${__dirname}/index.html`); + mainWindow.webContents.on('did-finish-load', () => { + mainWindow.webContents.send('ping', 'whoooooooh!'); }); }); ``` @@ -761,8 +762,8 @@ app.on('ready', function() { @@ -878,8 +879,8 @@ Input `event`를 웹 페이지로 전송합니다. ```javascript win.loadURL('https://github.com'); -win.webContents.on('did-finish-load', function() { - win.webContents.savePage('/tmp/test.html', 'HTMLComplete', function(error) { +win.webContents.on('did-finish-load', () => { + win.webContents.savePage('/tmp/test.html', 'HTMLComplete', (error) => { if (!error) console.log("Save page successfully"); }); @@ -916,13 +917,13 @@ try { console.log("Debugger attach failed : ", err); }; -win.webContents.debugger.on('detach', function(event, reason) { +win.webContents.debugger.on('detach', (event, reason) => { console.log("Debugger detached due to : ", reason); }); -win.webContents.debugger.on('message', function(event, method, params) { - if (method == "Network.requestWillBeSent") { - if (params.request.url == "https://www.github.com") +win.webContents.debugger.on('message', (event, method, params) => { + if (method === "Network.requestWillBeSent") { + if (params.request.url === "https://www.github.com") win.webContents.debugger.detach(); } }) diff --git a/docs-translations/ko-KR/api/web-frame.md b/docs-translations/ko-KR/api/web-frame.md index 4b9ade4bebed..73566b50bd32 100644 --- a/docs-translations/ko-KR/api/web-frame.md +++ b/docs-translations/ko-KR/api/web-frame.md @@ -5,7 +5,7 @@ 다음 예시는 현재 페이지를 200% 줌 합니다: ```javascript -var webFrame = require('electron').webFrame; +const { webFrame } = require('electron'); webFrame.setZoomFactor(2); ``` diff --git a/docs-translations/ko-KR/api/web-view-tag.md b/docs-translations/ko-KR/api/web-view-tag.md index 63b6a92ae896..ab56e2c96a4a 100644 --- a/docs-translations/ko-KR/api/web-view-tag.md +++ b/docs-translations/ko-KR/api/web-view-tag.md @@ -29,18 +29,20 @@ ```html ``` @@ -205,7 +207,7 @@ API를 사용할 수 있습니다. 이를 지정하면 내부에서 로우레벨 **예시** ```javascript -webview.addEventListener("dom-ready", function() { +webview.addEventListener("dom-ready", () => { webview.openDevTools(); }); ``` @@ -631,10 +633,12 @@ Returns: 다음 예시 코드는 새 URL을 시스템의 기본 브라우저로 여는 코드입니다. ```javascript -webview.addEventListener('new-window', function(e) { - var protocol = require('url').parse(e.url).protocol; +const { shell } = require('electron'); + +webview.addEventListener('new-window', (e) => { + const protocol = require('url').parse(e.url).protocol; if (protocol === 'http:' || protocol === 'https:') { - require('electron').shell.openExternal(e.url); + shell.openExternal(e.url); } }); ``` @@ -687,7 +691,7 @@ Returns: 이동시키는 예시입니다. ```javascript -webview.addEventListener('close', function() { +webview.addEventListener('close', () => { webview.src = 'about:blank'; }); ``` @@ -706,7 +710,7 @@ Returns: ```javascript // In embedder page. -webview.addEventListener('ipc-message', function(event) { +webview.addEventListener('ipc-message', (event) => { console.log(event.channel); // Prints "pong" }); @@ -715,8 +719,8 @@ webview.send('ping'); ```javascript // In guest page. -var ipcRenderer = require('electron').ipcRenderer; -ipcRenderer.on('ping', function() { +var { ipcRenderer } = require('electron'); +ipcRenderer.on('ping', () => { ipcRenderer.sendToHost('pong'); }); ``` diff --git a/docs-translations/ko-KR/faq/electron-faq.md b/docs-translations/ko-KR/faq/electron-faq.md index ae77335b0008..f74867caded2 100644 --- a/docs-translations/ko-KR/faq/electron-faq.md +++ b/docs-translations/ko-KR/faq/electron-faq.md @@ -62,16 +62,16 @@ console.log(require('remote').getGlobal('sharedObject').someProperty); 만약 빠르게 고치고 싶다면, 다음과 같이 변수를 전역 변수로 만드는 방법이 있습니다: ```javascript -app.on('ready', function() { - var tray = new Tray('/path/to/icon.png'); +app.on('ready', () => { + const tray = new Tray('/path/to/icon.png'); }) ``` 를 이렇게: ```javascript -var tray = null; -app.on('ready', function() { +let tray = null; +app.on('ready', () => { tray = new Tray('/path/to/icon.png'); }) ``` @@ -86,7 +86,7 @@ Node.js가 Electron에 합쳐졌기 때문에, DOM에 `module`, `exports`, `requ ```javascript // 메인 프로세스에서. -var mainWindow = new BrowserWindow({ +let mainWindow = new BrowserWindow({ webPreferences: { nodeIntegration: false } diff --git a/docs-translations/ko-KR/tutorial/application-packaging.md b/docs-translations/ko-KR/tutorial/application-packaging.md index bc56d824617a..2cef8ea9c70d 100644 --- a/docs-translations/ko-KR/tutorial/application-packaging.md +++ b/docs-translations/ko-KR/tutorial/application-packaging.md @@ -70,8 +70,8 @@ require('/path/to/example.asar/dir/module.js'); `BrowserWindow` 클래스를 이용해 원하는 웹 페이지도 표시할 수 있습니다: ```javascript -const BrowserWindow = require('electron').BrowserWindow; -var win = new BrowserWindow({width: 800, height: 600}); +const { BrowserWindow } = require('electron'); +let win = new BrowserWindow({width: 800, height: 600}); win.loadURL('file:///path/to/example.asar/static/index.html'); ``` @@ -85,7 +85,7 @@ win.loadURL('file:///path/to/example.asar/static/index.html'); ```html @@ -99,7 +99,7 @@ $.get('file:///path/to/example.asar/file.txt', function(data) { 읽어들입니다: ```javascript -var originalFs = require('original-fs'); +const originalFs = require('original-fs'); originalFs.readFileSync('/path/to/example.asar'); ``` diff --git a/docs-translations/ko-KR/tutorial/desktop-environment-integration.md b/docs-translations/ko-KR/tutorial/desktop-environment-integration.md index 44cc66352425..46bd5dae01bd 100644 --- a/docs-translations/ko-KR/tutorial/desktop-environment-integration.md +++ b/docs-translations/ko-KR/tutorial/desktop-environment-integration.md @@ -17,7 +17,7 @@ Windows, Linux, OS X 운영체제 모두 기본적으로 어플리케이션에 **참고:** 이 API는 HTML5 API이기 때문에 렌더러 프로세스에서만 사용할 수 있습니다. ```javascript -var myNotification = new Notification('Title', { +let myNotification = new Notification('Title', { body: 'Lorem Ipsum Dolor Sit Amet' }); @@ -114,8 +114,8 @@ const electron = require('electron'); const app = electron.app; const Menu = electron.Menu; -var dockMenu = Menu.buildFromTemplate([ - { label: 'New Window', click: function() { console.log('New Window'); } }, +const dockMenu = Menu.buildFromTemplate([ + { label: 'New Window', click: () => { console.log('New Window'); } }, { label: 'New Window with Settings', submenu: [ { label: 'Basic' }, { label: 'Pro'} @@ -203,24 +203,25 @@ __Windows Media Player의 미리보기 툴바:__ 미리보기 툴바를 설정할 수 있습니다: ```javascript -const BrowserWindow = require('electron').BrowserWindow; +const { BrowserWindow } = require('electron'); const path = require('path'); -var win = new BrowserWindow({ +let win = new BrowserWindow({ width: 800, height: 600 }); + win.setThumbarButtons([ { tooltip: "button1", icon: path.join(__dirname, 'button1.png'), - click: function() { console.log("button2 clicked"); } + click: () => { console.log("button2 clicked"); } }, { tooltip: "button2", icon: path.join(__dirname, 'button2.png'), flags:['enabled', 'dismissonclick'], - click: function() { console.log("button2 clicked."); } + click: () => { console.log("button2 clicked."); } } ]); ``` @@ -259,7 +260,7 @@ __작업 표시줄 버튼의 프로그래스 바:__ 있습니다: ```javascript -var window = new BrowserWindow({...}); +let window = new BrowserWindow({...}); window.setProgressBar(0.5); ``` @@ -286,7 +287,7 @@ __작업 표시줄 버튼 위의 오버레이:__ API를 사용할 수 있습니다: ```javascript -var window = new BrowserWindow({...}); +let window = new BrowserWindow({...}); window.setOverlayIcon('path/to/overlay.png', 'Description for overlay'); ``` @@ -305,7 +306,7 @@ __대표 파일 팝업 메뉴:__ [BrowserWindow.setDocumentEdited][setdocumentedited]를 사용할 수 있습니다: ```javascript -var window = new BrowserWindow({...}); +let window = new BrowserWindow({...}); window.setRepresentedFilename('/etc/passwd'); window.setDocumentEdited(true); ``` diff --git a/docs-translations/ko-KR/tutorial/online-offline-events.md b/docs-translations/ko-KR/tutorial/online-offline-events.md index 698544e83b6c..75dcf05805b5 100644 --- a/docs-translations/ko-KR/tutorial/online-offline-events.md +++ b/docs-translations/ko-KR/tutorial/online-offline-events.md @@ -10,8 +10,9 @@ const electron = require('electron'); const app = electron.app; const BrowserWindow = electron.BrowserWindow; -var onlineStatusWindow; -app.on('ready', function() { +let onlineStatusWindow; + +app.on('ready', () => { onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false }); onlineStatusWindow.loadURL('file://' + __dirname + '/online-status.html'); }); @@ -24,7 +25,7 @@ _online-status.html_ @@ -52,7 +52,7 @@ app.on('ready', () => { 직관적으로 사용할 수 있습니다: ```javascript -const { app, BrowserWindow } = require('electron'); +const {app, BrowserWindow} = require('electron'); ``` 모든 `electron` 모듈이 필요하다면, 먼저 require한 후 각 독립적인 모듈을 @@ -60,7 +60,7 @@ const { app, BrowserWindow } = require('electron'); ```javascript const electron = require('electron'); -const { app, BrowserWindow } = electron; +const {app, BrowserWindow} = electron; ``` 위 코드는 다음과 같습니다: @@ -87,7 +87,7 @@ process.env.ELECTRON_HIDE_INTERNAL_MODULES = 'true' 또는 `hideInternalModules` API를 사용해도 됩니다: ```javascript -require('electron').hideInternalModules() +require('electron').hideInternalModules(); ``` [gui]: https://en.wikipedia.org/wiki/Graphical_user_interface diff --git a/docs-translations/ko-KR/api/system-preferences.md b/docs-translations/ko-KR/api/system-preferences.md index fa3996872d36..c5707ea7eaf1 100644 --- a/docs-translations/ko-KR/api/system-preferences.md +++ b/docs-translations/ko-KR/api/system-preferences.md @@ -56,7 +56,7 @@ OS X에선 API가 `NSUserDefaults`를 읽어들입니다. 유명한 `key`와 `ty 예시입니다 (투명한 윈도우는 DWM 컴포지션이 비활성화되어있을 시 작동하지 않습니다): ```javascript -let browserOptions = { width: 1000, height: 800 }; +let browserOptions = {width: 1000, height: 800}; // 플랫폼이 지원하는 경우에만 투명 윈도우를 생성. if (process.platform !== 'win32' || systemPreferences.isAeroGlassEnabled()) { diff --git a/docs-translations/ko-KR/api/tray.md b/docs-translations/ko-KR/api/tray.md index 6cfecd4be8d9..d208de250201 100644 --- a/docs-translations/ko-KR/api/tray.md +++ b/docs-translations/ko-KR/api/tray.md @@ -3,16 +3,16 @@ > 아이콘과 컨텍스트 메뉴를 시스템 알림 영역에 추가합니다. ```javascript -const { app, Menu, Tray } = require('electron'); +const {app, Menu, Tray} = require('electron'); let appIcon = null; app.on('ready', () => { appIcon = new Tray('/path/to/my/icon'); // 현재 어플리케이션 디렉터리를 기준으로 하려면 `__dirname + '/images/tray.png'` 형식으로 입력해야 합니다. const contextMenu = Menu.buildFromTemplate([ - { label: 'Item1', type: 'radio' }, - { label: 'Item2', type: 'radio' }, - { label: 'Item3', type: 'radio', checked: true }, - { label: 'Item4', type: 'radio' } + {label: 'Item1', type: 'radio'}, + {label: 'Item2', type: 'radio'}, + {label: 'Item3', type: 'radio', checked: true}, + {label: 'Item4', type: 'radio'} ]); appIcon.setToolTip('이것은 나의 어플리케이션 입니다!'); appIcon.setContextMenu(contextMenu); diff --git a/docs-translations/ko-KR/api/web-contents.md b/docs-translations/ko-KR/api/web-contents.md index ae7b6d2af0d7..d0d7bd43b4b9 100644 --- a/docs-translations/ko-KR/api/web-contents.md +++ b/docs-translations/ko-KR/api/web-contents.md @@ -8,10 +8,10 @@ 접근하는 예시입니다: ```javascript -const { BrowserWindow } = require('electron'); +const BrowserWindow = require('electron').BrowserWindow; let win = new BrowserWindow({width: 800, height: 1500}); -win.loadURL("http://github.com"); +win.loadURL('http://github.com'); let webContents = win.webContents; ``` @@ -38,8 +38,7 @@ Returns: 이 이벤트는 `did-finish-load`와 비슷하나, 로드가 실패했거나 취소되었을 때 발생합니다. 예를 들면 `window.stop()`이 실행되었을 때 발생합니다. 발생할 수 있는 전체 에러 코드의 목록과 설명은 [여기](https://code.google.com/p/chromium/codesearch#chromium/src/net/base/net_error_list.h)서 -확인할 수 있습니다. 참고로 리다이렉트 응답은 `errorCode` -3과 함께 발생합니다; 이 -에러는 명시적으로 무시할 수 있습니다. +확인할 수 있습니다. ### Event: 'did-frame-finish-load' @@ -226,7 +225,7 @@ Returns: * `issuerName` String - 인증서 발급자 이름 * `callback` Function -클라이언트 인증이 요청되었을 때 발생하는 이벤트입니다. +클라이언트 인증이 요청되었을 때 발생하는 이벤트 입니다. 사용법은 [`app`의 `select-client-certificate` 이벤트](app.md#event-select-client-certificate)와 같습니다. @@ -293,7 +292,7 @@ Returns: * `image` NativeImage (optional) * `scale` Float (optional) -커서 타입이 변경될 때 발생하는 이벤트입니다. `type` 인수는 다음 값이 될 수 있습니다: +커서 타입이 변경될 때 발생하는 이벤트입니다. `type` 매개변수는 다음 값이 될 수 있습니다: `default`, `crosshair`, `pointer`, `text`, `wait`, `help`, `e-resize`, `n-resize`, `ne-resize`, `nw-resize`, `s-resize`, `se-resize`, `sw-resize`, `w-resize`, `ns-resize`, `ew-resize`, `nesw-resize`, `nwse-resize`, `col-resize`, @@ -302,59 +301,10 @@ Returns: `cell`, `context-menu`, `alias`, `progress`, `nodrop`, `copy`, `none`, `not-allowed`, `zoom-in`, `zoom-out`, `grab`, `grabbing`, `custom`. -만약 `type` 인수가 `custom` 이고 `image` 인수가 `NativeImage`를 통한 커스텀 -커서를 지정했을 때, 해당 이미지로 커서가 변경됩니다. 또한 `scale` 인수는 이미지의 +만약 `type` 매개변수가 `custom` 이고 `image` 매개변수가 `NativeImage`를 통한 커스텀 +커서를 지정했을 때, 해당 이미지로 커서가 변경됩니다. 또한 `scale` 매개변수는 이미지의 크기를 조정합니다. -### Event: 'context-menu' - -Returns: - -* `event` Event -* `params` Object - * `x` Integer - x 좌표 - * `y` Integer - y 좌표 - * `linkURL` String - 컨텍스트 메뉴가 호출된 노드를 둘러싸는 링크의 URL. - * `linkText` String - 링크에 연관된 텍스트. 콘텐츠의 링크가 이미지인 경우 빈 - 문자열이 됩니다. - * `pageURL` String - 컨텍스트 메뉴가 호출된 상위 수준 페이지의 URL. - * `frameURL` String - 컨텍스트 메뉴가 호출된 서브 프레임의 URL. - * `srcURL` String - 컨텍스트 메뉴가 호출된 요소에 대한 소스 URL. 요소와 소스 URL은 - 이미지, 오디오, 비디오입니다. - * `mediaType` String - 컨텍스트 메뉴가 호출된 노드의 타입. 값은 `none`, `image`, - `audio`, `video`, `canvas`, `file` 또는 `plugin`이 될 수 있습니다. - * `mediaFlags` Object - 컨텍스트 메뉴가 호출된 미디어 요소에 대한 인수들. - * `inError` - Boolean - * `isPaused` - Boolean - * `isMuted` - Boolean - * `hasAudio` - Boolean - * `isLooping` - Boolean - * `isControlsVisible` - Boolean - * `canToggleControls` - Boolean - * `canRotate` - Boolean - * `hasImageContent` Boolean - 컨텍스트 메뉴가 내용이 있는 이미지에서 호출되었는지 - 여부. - * `isEditable` Boolean - 컨텍스트를 편집할 수 있는지 여부. - * `editFlags` Object - 이 플래그는 랜더러가 다음 행동을 취할 수 있는지 여부를 - 표시합니다. - * `canUndo` - Boolean - * `canRedo` - Boolean - * `canCut` - Boolean - * `canCopy` - Boolean - * `canPaste` - Boolean - * `canDelete` - Boolean - * `canSelectAll` - Boolean - * `selectionText` String - 컨텍스트 메뉴가 호출된 부분에 있는 선택된 텍스트. - * `titleText` String - 컨텍스트 메뉴가 호출된 선택된 제목 또는 알림 텍스트. - * `misspelledWord` String - 만약 있는 경우, 커서가 가르키는 곳에서 발생한 오타. - * `frameCharset` String - 메뉴가 호출된 프레임의 문자열 인코딩. - * `inputFieldType` String - 컨텍스트 메뉴가 입력 필드에서 호출되었을 때, 그 필드의 - 타입. 값은 `none`, `plainText`, `password`, `other` 중 한 가지가 될 수 있습니다. - * `menuSourceType` String - 컨텍스트 메뉴를 호출한 입력 소스. 값은 `none`, - `mouse`, `keyboard`, `touch`, `touchMenu` 중 한 가지가 될 수 있습니다. - -새로운 컨텍스트 메뉴의 제어가 필요할 때 발생하는 이벤트입니다. - ## Instance Methods `webContents`객체는 다음과 같은 인스턴스 메서드들을 가지고 있습니다. @@ -372,7 +322,7 @@ Returns: 하는 경우 `pragma` 헤더를 사용할 수 있습니다. ```javascript -const options = {"extraHeaders" : "pragma: no-cache\n"} +const options = {extraHeaders: 'pragma: no-cache\n'}; webContents.loadURL(url, options) ``` @@ -389,7 +339,7 @@ webContents.loadURL(url, options) ```javascript let win = new BrowserWindow({width: 800, height: 600}); -win.loadURL("http://github.com"); +win.loadURL('http://github.com'); let currentURL = win.webContents.getURL(); ``` @@ -583,12 +533,12 @@ CSS 코드를 현재 웹 페이지에 삽입합니다. 제공된 `action`에 대한 `webContents`의 모든 `findInPage` 요청을 중지합니다. ```javascript -webContents.on('found-in-page', function(event, result) { +webContents.on('found-in-page', (event, result) => { if (result.finalUpdate) - webContents.stopFindInPage("clearSelection"); + webContents.stopFindInPage('clearSelection'); }); -const requestId = webContents.findInPage("api"); +const requestId = webContents.findInPage('api'); ``` ### `webContents.hasServiceWorker(callback)` @@ -626,7 +576,7 @@ print기능을 사용하지 않는 경우 전체 바이너리 크기를 줄이 ### `webContents.printToPDF(options, callback)` * `options` Object - * `marginsType` Integer - 사용할 마진의 타입을 지정합니다. 0 부터 2 사이 값을 사용할 + * `marginsType` Integer - 사용할 마진의 종류를 지정합니다. 0 부터 2 사이 값을 사용할 수 있고 각각 기본 마진, 마진 없음, 최소 마진입니다. * `pageSize` String - 생성되는 PDF의 페이지 크기를 지정합니다. 값은 `A3`, `A4`, `A5`, `Legal`, `Letter` 와 `Tabloid`가 사용될 수 있습니다. @@ -634,7 +584,7 @@ print기능을 사용하지 않는 경우 전체 바이너리 크기를 줄이 * `printSelectionOnly` Boolean - 선택된 영역만 프린트할지 여부를 정합니다. * `landscape` Boolean - landscape을 위해선 `true`를, portrait를 위해선 `false`를 사용합니다. -* `callback` Function - `function(error, data) {}` +* `callback` Function - `(error, data) => {}` Chromium의 미리보기 프린팅 커스텀 설정을 이용하여 윈도우의 웹 페이지를 PDF로 프린트합니다. @@ -654,14 +604,14 @@ Chromium의 미리보기 프린팅 커스텀 설정을 이용하여 윈도우의 ``` ```javascript -const { BrowserWindow } = require('electron'); +const BrowserWindow = require('electron').BrowserWindow; const fs = require('fs'); let win = new BrowserWindow({width: 800, height: 600}); win.loadURL('http://github.com'); win.webContents.on('did-finish-load', () => { - // 기본 프린트 옵션을 사용합니다 + // Use default printing options win.webContents.printToPDF({}, (error, data) => { if (error) throw error; fs.writeFile('/tmp/print.pdf', data, (error) => { @@ -681,8 +631,8 @@ win.webContents.on('did-finish-load', () => { 이후에 사용해야 합니다. ```javascript -mainWindow.webContents.on('devtools-opened', function() { - mainWindow.webContents.addWorkSpace(__dirname); +win.webContents.on('devtools-opened', () => { + win.webContents.addWorkSpace(__dirname); }); ``` @@ -696,9 +646,9 @@ mainWindow.webContents.on('devtools-opened', function() { * `options` Object (optional) * `detach` Boolean - 새 창에서 개발자 도구를 엽니다. - * `mode` String - 개발자 도구를 지정한 도킹 상태와 함께 엽니다. 옵션은 `right`, - `bottom`, `undocked`, `detach`가 될 수 있습니다. 기본값은 마지막 표시 상태를 - 사용합니다. `undocked` 모드에선 다시 도킹을 할 수 있습니다. 하지만 `detach` + * `mode` String - 개발자 도구 표시 상태를 지정합니다. 옵션은 "right", "bottom", + "undocked", "detach"가 될 수 있습니다. 기본값은 마지막 표시 상태를 + 사용합니다. `undocked` 모드에선 다시 독을 할 수 있습니다. 하지만 `detach` 모드에선 할 수 없습니다. 개발자 도구를 엽니다. @@ -745,14 +695,13 @@ mainWindow.webContents.on('devtools-opened', function() { 메인 프로세스에서 렌더러 프로세스로 메시지를 보내는 예시 입니다: ```javascript -// 메인 프로세스에서. -let mainWindow = null; - +// In the main process. +let win = null; app.on('ready', () => { - mainWindow = new BrowserWindow({width: 800, height: 600}); - mainWindow.loadURL(`file://${__dirname}/index.html`); - mainWindow.webContents.on('did-finish-load', () => { - mainWindow.webContents.send('ping', 'whoooooooh!'); + win = new BrowserWindow({width: 800, height: 600}); + win.loadURL('file://' + __dirname + '/index.html'); + win.webContents.on('did-finish-load', () => { + win.webContents.send('ping', 'whoooooooh!'); }); }); ``` @@ -763,7 +712,7 @@ app.on('ready', () => { @@ -871,7 +820,7 @@ Input `event`를 웹 페이지로 전송합니다. * `HTMLOnly` - 페이지의 HTML만 저장합니다. * `HTMLComplete` - 페이지의 완성된 HTML을 저장합니다. * `MHTML` - 페이지의 완성된 HTML을 MHTML로 저장합니다. -* `callback` Function - `function(error) {}`. +* `callback` Function - `(error) => {}`. * `error` Error 만약 페이지를 저장하는 프로세스가 성공적으로 끝났을 경우 true를 반환합니다. @@ -882,7 +831,7 @@ win.loadURL('https://github.com'); win.webContents.on('did-finish-load', () => { win.webContents.savePage('/tmp/test.html', 'HTMLComplete', (error) => { if (!error) - console.log("Save page successfully"); + console.log('Save page successfully'); }); }); ``` @@ -912,23 +861,23 @@ win.webContents.on('did-finish-load', () => { ```javascript try { - win.webContents.debugger.attach("1.1"); + win.webContents.debugger.attach('1.1'); } catch(err) { - console.log("Debugger attach failed : ", err); + console.log('Debugger attach failed : ', err); }; win.webContents.debugger.on('detach', (event, reason) => { - console.log("Debugger detached due to : ", reason); + console.log('Debugger detached due to : ', reason); }); win.webContents.debugger.on('message', (event, method, params) => { - if (method === "Network.requestWillBeSent") { - if (params.request.url === "https://www.github.com") + if (method === 'Network.requestWillBeSent') { + if (params.request.url === 'https://www.github.com') win.webContents.debugger.detach(); } -}) +}); -win.webContents.debugger.sendCommand("Network.enable"); +win.webContents.debugger.sendCommand('Network.enable'); ``` #### `webContents.debugger.attach([protocolVersion])` @@ -949,7 +898,7 @@ win.webContents.debugger.sendCommand("Network.enable"); * `method` String - 메서드 이름, 반드시 원격 디버깅 프로토콜에 의해 정의된 메서드중 하나가 됩니다. -* `commandParams` Object (optional) - 요청 인수를 표현한 JSON 객체. +* `commandParams` Object (optional) - 요청 매개변수를 표현한 JSON 객체. * `callback` Function (optional) - 응답 * `error` Object - 커맨드의 실패를 표시하는 에러 메시지. * `result` Object - 원격 디버깅 프로토콜에서 커맨드 설명의 'returns' 속성에 의해 @@ -969,7 +918,8 @@ win.webContents.debugger.sendCommand("Network.enable"); * `event` Event * `method` String - 메서드 이름. -* `params` Object - 원격 디버깅 프로토콜의 'parameters' 속성에서 정의된 이벤트 인수 +* `params` Object - 원격 디버깅 프로토콜의 'parameters' 속성에서 정의된 이벤트 + 매개변수 디버깅 타겟이 관련 이벤트를 발생시킬 때 마다 발생하는 이벤트입니다. diff --git a/docs-translations/ko-KR/api/web-frame.md b/docs-translations/ko-KR/api/web-frame.md index 73566b50bd32..69e563df3f59 100644 --- a/docs-translations/ko-KR/api/web-frame.md +++ b/docs-translations/ko-KR/api/web-frame.md @@ -5,7 +5,7 @@ 다음 예시는 현재 페이지를 200% 줌 합니다: ```javascript -const { webFrame } = require('electron'); +const {webFrame} = require('electron'); webFrame.setZoomFactor(2); ``` @@ -58,8 +58,8 @@ Input field나 text area에 철자 검사(spell checking) 제공자를 설정합 [node-spellchecker][spellchecker]를 철자 검사 제공자로 사용하는 예시입니다: ```javascript -webFrame.setSpellCheckProvider("en-US", true, { - spellCheck: function(text) { +webFrame.setSpellCheckProvider('en-US', true, { + spellCheck(text) { return !(require('spellchecker').isMisspelled(text)); } }); diff --git a/docs-translations/ko-KR/api/web-view-tag.md b/docs-translations/ko-KR/api/web-view-tag.md index ab56e2c96a4a..3191db71331e 100644 --- a/docs-translations/ko-KR/api/web-view-tag.md +++ b/docs-translations/ko-KR/api/web-view-tag.md @@ -35,15 +35,15 @@ const loadstart = () => { indicator.innerText = 'loading...'; - } + }; const loadstop = () => { indicator.innerText = ''; - } + }; webview.addEventListener('did-start-loading', loadstart); webview.addEventListener('did-stop-loading', loadstop); - } + }; ``` @@ -207,7 +207,7 @@ API를 사용할 수 있습니다. 이를 지정하면 내부에서 로우레벨 **예시** ```javascript -webview.addEventListener("dom-ready", () => { +webview.addEventListener('dom-ready', () => { webview.openDevTools(); }); ``` @@ -590,7 +590,7 @@ Returns: 콘솔에 다시 로깅하는 예시입니다. ```javascript -webview.addEventListener('console-message', function(e) { +webview.addEventListener('console-message', (e) => { console.log('Guest page logged a message:', e.message); }); ``` @@ -610,12 +610,12 @@ Returns: 사용할 수 있을 때 발생하는 이벤트입니다. ```javascript -webview.addEventListener('found-in-page', function(e) { +webview.addEventListener('found-in-page', (e) => { if (e.result.finalUpdate) - webview.stopFindInPage("keepSelection"); + webview.stopFindInPage('keepSelection'); }); -const rquestId = webview.findInPage("test"); +const rquestId = webview.findInPage('test'); ``` ### Event: 'new-window' @@ -633,7 +633,7 @@ Returns: 다음 예시 코드는 새 URL을 시스템의 기본 브라우저로 여는 코드입니다. ```javascript -const { shell } = require('electron'); +const {shell} = require('electron'); webview.addEventListener('new-window', (e) => { const protocol = require('url').parse(e.url).protocol; @@ -719,7 +719,7 @@ webview.send('ping'); ```javascript // In guest page. -var { ipcRenderer } = require('electron'); +const {ipcRenderer} = require('electron'); ipcRenderer.on('ping', () => { ipcRenderer.sendToHost('pong'); }); diff --git a/docs-translations/ko-KR/faq/electron-faq.md b/docs-translations/ko-KR/faq/electron-faq.md index f74867caded2..38235e2d8980 100644 --- a/docs-translations/ko-KR/faq/electron-faq.md +++ b/docs-translations/ko-KR/faq/electron-faq.md @@ -64,7 +64,7 @@ console.log(require('remote').getGlobal('sharedObject').someProperty); ```javascript app.on('ready', () => { const tray = new Tray('/path/to/icon.png'); -}) +}); ``` 를 이렇게: @@ -73,7 +73,7 @@ app.on('ready', () => { let tray = null; app.on('ready', () => { tray = new Tray('/path/to/icon.png'); -}) +}); ``` ## Electron에서 jQuery/RequireJS/Meteor/AngularJS를 사용할 수 없습니다. @@ -86,7 +86,7 @@ Node.js가 Electron에 합쳐졌기 때문에, DOM에 `module`, `exports`, `requ ```javascript // 메인 프로세스에서. -let mainWindow = new BrowserWindow({ +let win = new BrowserWindow({ webPreferences: { nodeIntegration: false } diff --git a/docs-translations/ko-KR/styleguide.md b/docs-translations/ko-KR/styleguide.md index bf9eba1ee2d6..340fa4204a05 100644 --- a/docs-translations/ko-KR/styleguide.md +++ b/docs-translations/ko-KR/styleguide.md @@ -94,5 +94,5 @@ Returns: ```javascript Alarm.on('wake-up', (time) => { console.log(time) -}) +}); ``` diff --git a/docs-translations/ko-KR/tutorial/application-packaging.md b/docs-translations/ko-KR/tutorial/application-packaging.md index 2cef8ea9c70d..8002350b56b1 100644 --- a/docs-translations/ko-KR/tutorial/application-packaging.md +++ b/docs-translations/ko-KR/tutorial/application-packaging.md @@ -70,7 +70,7 @@ require('/path/to/example.asar/dir/module.js'); `BrowserWindow` 클래스를 이용해 원하는 웹 페이지도 표시할 수 있습니다: ```javascript -const { BrowserWindow } = require('electron'); +const {BrowserWindow} = require('electron'); let win = new BrowserWindow({width: 800, height: 600}); win.loadURL('file:///path/to/example.asar/static/index.html'); ``` @@ -84,7 +84,7 @@ win.loadURL('file:///path/to/example.asar/static/index.html'); ```html