Create Instance Properties section

This commit is contained in:
Jessica Lord 2015-09-09 13:57:35 -07:00
parent 6abc4fb255
commit 5593717d78

View file

@ -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