Merge branch 'master' into native-window-open

This commit is contained in:
Ryohei Ikegami 2017-04-27 12:03:55 +09:00
commit 1d73e84a29
59 changed files with 989 additions and 241 deletions

View file

@ -377,6 +377,11 @@ window.onbeforeunload = (e) => {
Emitted when the window is closed. After you have received this event you should
remove the reference to the window and avoid using it any more.
#### Event: 'session-end' _Windows_
Emitted when window session is going to end due to force shutdown or machine restart
or session log off.
#### Event: 'unresponsive'
Emitted when the web page becomes unresponsive.
@ -499,6 +504,14 @@ Returns:
Emitted on 3-finger swipe. Possible directions are `up`, `right`, `down`, `left`.
#### Event: 'sheet-begin' _macOS_
Emitted when the window opens a sheet.
#### Event: 'sheet-end' _macOS_
Emitted when the window has closed a sheet.
### Static Methods
The `BrowserWindow` class has the following static methods:

View file

@ -104,3 +104,9 @@ on complete.
Removes the cookies matching `url` and `name`, `callback` will called with
`callback()` on complete.
#### `cookies.flushStore(callback)`
* `callback` Function
Writes any unwritten cookies data to disk.

View file

@ -100,6 +100,8 @@ Returns `Boolean` - Whether the download is paused.
Resumes the download that has been paused.
**Note:** To enable resumable downloads the server you are downloading from must support range requests and provide both `Last-Modified` and `ETag` header values. Otherwise `resume()` will dismiss previously received bytes and restart the download from the beginning.
#### `downloadItem.canResume()`
Resumes `Boolean` - Whether the download can resume.

View file

@ -70,7 +70,7 @@ The `role` property can have following values:
* `editMenu` - Whole default "Edit" menu (Undo, Copy, etc.)
* `windowMenu` - Whole default "Window" menu (Minimize, Close, etc.)
The following additional roles are avaiable on macOS:
The following additional roles are available on macOS:
* `about` - Map to the `orderFrontStandardAboutPanel` action
* `hide` - Map to the `hide` action
@ -120,4 +120,4 @@ A String representing the menu items visible label
#### `menuItem.click`
A Function that is fired when the MenuItem recieves a click event
A Function that is fired when the MenuItem receives a click event

View file

@ -28,6 +28,10 @@ effect on macOS.
Returns `Menu` - The application menu, if set, or `null`, if not set.
**Note:** The returned `Menu` instance doesn't support dynamic addition or
removal of menu items. [Instance properties](#instance-properties) can still
be dynamically modified.
#### `Menu.sendActionToFirstResponder(action)` _macOS_
* `action` String

View file

@ -11,6 +11,7 @@ Process: [Main](../tutorial/quick-start.md#main-process)
* `backgroundColor` String (optional) - Button background color in hex format,
i.e `#ABCDEF`.
* `icon` [NativeImage](native-image.md) (optional) - Button icon.
* `iconPosition` String - Can be `left`, `right` or `overlay`.
* `click` Function (optional) - Function to call when the button is clicked.
### Instance Properties

View file

@ -16,6 +16,10 @@ Creates a new touch bar with the specified items. Use
**Note:** The TouchBar API is currently experimental and may change or be
removed in future Electron releases.
**Tip:** If you don't have a MacBook with Touch Bar, you can use
[Touch Bar Simulator](https://github.com/sindresorhus/touch-bar-simulator)
to test Touch Bar usage in your app.
### Instance Properties
The following properties are available on instances of `TouchBar`:

View file

@ -12,7 +12,8 @@ rendered.
Unlike an `iframe`, the `webview` runs in a separate process than your
app. It doesn't have the same permissions as your web page and all interactions
between your app and embedded content will be asynchronous. This keeps your app
safe from the embedded content.
safe from the embedded content. **Note:** Most methods called on the
webview from the host page require a syncronous call to the main process.
For security purposes, `webview` can only be used in `BrowserWindow`s that have
`nodeIntegration` enabled.

View file

@ -30,6 +30,10 @@ has to be a field of `BrowserWindow`'s options.
* Node integration will always be disabled in the opened `window` if it is
disabled on the parent window.
* Context isolation will always be enabled in the opened `window` if it is
enabled on the parent window.
* JavaScript will always be disabled in the opened `window` if it is disabled on
the parent window.
* Non-standard features (that are not handled by Chromium or Electron) given in
`features` will be passed to any registered `webContent`'s `new-window` event
handler in the `additionalFeatures` argument.