Update as upstream

This commit is contained in:
Plusb Preco 2015-07-15 08:30:02 +09:00
parent 26163e5812
commit b524914008
5 changed files with 65 additions and 25 deletions

View file

@ -16,7 +16,7 @@ win.show();
``` ```
You can also create a window without chrome by using You can also create a window without chrome by using
[Frameless Window](frameless-window-ko.md) API. [Frameless Window](frameless-window.md) API.
## Class: BrowserWindow ## Class: BrowserWindow
@ -48,11 +48,11 @@ You can also create a window without chrome by using
zoom percent / 100, so `3.0` represents `300%` zoom percent / 100, so `3.0` represents `300%`
* `kiosk` Boolean - The kiosk mode * `kiosk` Boolean - The kiosk mode
* `title` String - Default window title * `title` String - Default window title
* `icon` [NativeImage](native-image-ko.md) - The window icon, when omitted on * `icon` [NativeImage](native-image.md) - The window icon, when omitted on
Windows the executable's icon would be used as window icon Windows the executable's icon would be used as window icon
* `show` Boolean - Whether window should be shown when created * `show` Boolean - Whether window should be shown when created
* `frame` Boolean - Specify `false` to create a * `frame` Boolean - Specify `false` to create a
[Frameless Window](frameless-window-ko.md) [Frameless Window](frameless-window.md)
* `node-integration` Boolean - Whether node integration is enabled, default * `node-integration` Boolean - Whether node integration is enabled, default
is `true` is `true`
* `accept-first-mouse` Boolean - Whether the web view accepts a single * `accept-first-mouse` Boolean - Whether the web view accepts a single
@ -68,7 +68,7 @@ You can also create a window without chrome by using
scripts run in the window. This script will always have access to node APIs scripts run in the window. This script will always have access to node APIs
no matter whether node integration is turned on for the window, and the path no matter whether node integration is turned on for the window, and the path
of `preload` script has to be absolute path. of `preload` script has to be absolute path.
* `transparent` Boolean - Makes the window [transparent](frameless-window-ko.md) * `transparent` Boolean - Makes the window [transparent](frameless-window.md)
* `type` String - Specifies the type of the window, possible types are * `type` String - Specifies the type of the window, possible types are
`desktop`, `dock`, `toolbar`, `splash`, `notification`. This only works on `desktop`, `dock`, `toolbar`, `splash`, `notification`. This only works on
Linux. Linux.
@ -566,11 +566,11 @@ Opens the developer tools for the service worker context present in the web cont
Captures the snapshot of page within `rect`, upon completion `callback` would be Captures the snapshot of page within `rect`, upon completion `callback` would be
called with `callback(image)`, the `image` is an instance of called with `callback(image)`, the `image` is an instance of
[NativeImage](native-image-ko.md) that stores data of the snapshot. Omitting the [NativeImage](native-image.md) that stores data of the snapshot. Omitting the
`rect` would capture the whole visible page. `rect` would capture the whole visible page.
**Note:** Be sure to read documents on remote buffer in **Note:** Be sure to read documents on remote buffer in
[remote](remote-ko.md) if you are going to use this API in renderer [remote](remote.md) if you are going to use this API in renderer
process. process.
### BrowserWindow.print([options]) ### BrowserWindow.print([options])
@ -613,7 +613,7 @@ it will assume `app.getName().desktop`.
### BrowserWindow.setOverlayIcon(overlay, description) ### BrowserWindow.setOverlayIcon(overlay, description)
* `overlay` [NativeImage](native-image-ko.md) - the icon to display on the bottom * `overlay` [NativeImage](native-image.md) - the icon to display on the bottom
right corner of the taskbar icon. If this parameter is `null`, the overlay is right corner of the taskbar icon. If this parameter is `null`, the overlay is
cleared cleared
* `description` String - a description that will be provided to Accessibility * `description` String - a description that will be provided to Accessibility
@ -784,6 +784,10 @@ Emitted when a plugin process is crashed.
Emitted when the WebContents is destroyed. Emitted when the WebContents is destroyed.
### WebContents.session
Returns the `Session` object used by this WebContents.
### WebContents.loadUrl(url, [options]) ### WebContents.loadUrl(url, [options])
* `url` URL * `url` URL
@ -1055,7 +1059,9 @@ app.on('ready', function() {
2. There is no way to send synchronous messages from the main process to a 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. renderer process, because it would be very easy to cause dead locks.
## Class: WebContents.session.cookies ## Class: Session
### Session.cookies
The `cookies` gives you ability to query and modify cookies, an example is: The `cookies` gives you ability to query and modify cookies, an example is:
@ -1091,7 +1097,7 @@ win.webContents.on('did-finish-load', function() {
}); });
``` ```
### WebContents.session.cookies.get(details, callback) ### Session.cookies.get(details, callback)
* `details` Object * `details` Object
* `url` String - Retrieves cookies which are associated with `url`. * `url` String - Retrieves cookies which are associated with `url`.
@ -1113,12 +1119,12 @@ win.webContents.on('did-finish-load', function() {
* `secure` Boolean - Whether the cookie is marked as Secure (typically HTTPS) * `secure` Boolean - Whether the cookie is marked as Secure (typically HTTPS)
* `http_only` Boolean - Whether the cookie is marked as HttpOnly * `http_only` Boolean - Whether the cookie is marked as HttpOnly
* `session` Boolean - Whether the cookie is a session cookie or a persistent * `session` Boolean - Whether the cookie is a session cookie or a persistent
cookie with an expiration date. cookie with an expiration date.
* `expirationDate` Double - (Option) The expiration date of the cookie as * `expirationDate` Double - (Option) The expiration date of the cookie as
the number of seconds since the UNIX epoch. Not provided for session cookies. the number of seconds since the UNIX epoch. Not provided for session cookies.
### WebContents.session.cookies.set(details, callback) ### Session.cookies.set(details, callback)
* `details` Object * `details` Object
* `url` String - Retrieves cookies which are associated with `url` * `url` String - Retrieves cookies which are associated with `url`
@ -1134,10 +1140,30 @@ win.webContents.on('did-finish-load', function() {
* `callback` Function - function(error) * `callback` Function - function(error)
* `error` Error * `error` Error
### WebContents.session.cookies.remove(details, callback) ### Session.cookies.remove(details, callback)
* `details` Object * `details` Object
* `url` String - The URL associated with the cookie * `url` String - The URL associated with the cookie
* `name` String - The name of cookie to remove * `name` String - The name of cookie to remove
* `callback` Function - function(error) * `callback` Function - function(error)
* `error` Error * `error` Error
### Session.clearCache(callback)
* `callback` Function - Called when operation is done
Clears the session's HTTP cache.
### Session.clearStorageData([options, ]callback)
* `options` Object
* `origin` String - Should follow `window.location.origin`'s representation
`scheme://host:port`
* `storages` Array - The types of storages to clear, can contain:
`appcache`, `cookies`, `filesystem`, `indexdb`, `localstorage`,
`shadercache`, `websql`, `serviceworkers`
* `quotas` Array - The types of quotas to clear, can contain:
`temporary`, `persistent`, `syncable`
* `callback` Function - Called when operation is done
Clears the data of web storages.

View file

@ -34,6 +34,10 @@ HTTP 요청 캐시를 비활성화 합니다.
시스템 설정의 프록시 서버를 무시하고 지정한 서버로 연결합니다. HTTP와 HTTPS 요청에만 적용됩니다. 시스템 설정의 프록시 서버를 무시하고 지정한 서버로 연결합니다. HTTP와 HTTPS 요청에만 적용됩니다.
## --proxy-pac-url=`url`
지정한 `url`의 PAC 스크립트를 사용합니다.
## --no-proxy-server ## --no-proxy-server
프록시 서버를 사용하지 않습니다. 다른 프록시 서버 플래그 및 설정을 무시하고 언제나 직접 연결을 사용합니다. 프록시 서버를 사용하지 않습니다. 다른 프록시 서버 플래그 및 설정을 무시하고 언제나 직접 연결을 사용합니다.

View file

@ -9,23 +9,23 @@ var app = require('app');
var globalShortcut = require('global-shortcut'); var globalShortcut = require('global-shortcut');
app.on('ready', function() { app.on('ready', function() {
// 'ctrl+x' 단축키를 리스너에 등록합니다. // 'ctrl+x' 단축키를 리스너에 등록합니다.
var ret = globalShortcut.register('ctrl+x', function() { console.log('ctrl+x is pressed'); }) var ret = globalShortcut.register('ctrl+x', function() { console.log('ctrl+x is pressed'); })
if (!ret) { if (!ret) {
console.log('registration failed'); console.log('registration failed');
} }
// 단축키가 등록되었는지 확인합니다. // 단축키가 등록되었는지 확인합니다.
console.log(globalShortcut.isRegistered('ctrl+x')); console.log(globalShortcut.isRegistered('ctrl+x'));
}); });
app.on('will-quit', function() { app.on('will-quit', function() {
// 단축키의 등록을 해제합니다. // 단축키의 등록을 해제합니다.
globalShortcut.unregister('ctrl+x'); globalShortcut.unregister('ctrl+x');
// 모든 단축키의 등록을 해제합니다. // 모든 단축키의 등록을 해제합니다.
globalShortcut.unregisterAll(); globalShortcut.unregisterAll();
}); });
``` ```

View file

@ -13,6 +13,9 @@ app.on('ready', function() {
protocol.registerProtocol('atom', function(request) { protocol.registerProtocol('atom', function(request) {
var url = request.url.substr(7) var url = request.url.substr(7)
return new protocol.RequestFileJob(path.normalize(__dirname + '/' + url)); return new protocol.RequestFileJob(path.normalize(__dirname + '/' + url));
}, function (error, scheme) {
if (!error)
console.log(scheme, ' registered successfully')
}); });
}); });
``` ```

View file

@ -46,7 +46,14 @@ $ ./script/bootstrap.py -v
### 크로스 컴파일 ### 크로스 컴파일
크로스 컴파일을 하려면 `bootstrap.py` 스크립트의 `--target_arch` 파라미터에 `arm` 또는 `ia32` 타겟 아키텍쳐를 전달하면 됩니다. `arm` 아키텍쳐로 빌드 하려면 먼저 종속성 라이브러리를 설치해야 합니다:
```bash
$ sudo apt-get install libc6-dev-armhf-cross linux-libc-dev-armhf-cross \
g++-arm-linux-gnueabihf
```
그리고 `bootstrap.py` 스크립트의 `--target_arch` 파라미터에 `arm` 또는 `ia32` 아키텍쳐를 지정하여 크로스 컴파일 할 수 있습니다:
```bash ```bash
$ ./script/bootstrap.py -v --target_arch=arm $ ./script/bootstrap.py -v --target_arch=arm