Merge pull request #6934 from electron/add-missing-class-descriptions

Give every class a description
This commit is contained in:
Kevin Sawicki 2016-08-23 10:16:29 -07:00 committed by GitHub
commit 1276587ebe
3 changed files with 23 additions and 13 deletions

View file

@ -145,7 +145,7 @@ Creates a new `NativeImage` instance from `dataURL`.
## Class: NativeImage
A native wrapper for images such as tray, dock, and application icons.
> Natively wrap images such as tray, dock, and application icons.
### Instance Methods

View file

@ -50,6 +50,8 @@ Returns the default session object of the app.
## Class: Session
> Get and set properties of a session.
You can create a `Session` object in the `session` module:
```javascript
@ -357,8 +359,10 @@ app.on('ready', function () {
## Class: Cookies
The `Cookies` class gives you ability to query and modify cookies. Instances of
`Cookies` class must be received by using `cookies` property of `Session` class.
> Query and modify a session's cookies.
Instances of the `Cookies` class are accessed by using `cookies` property of
a `Session`.
For example:
@ -450,21 +454,22 @@ Removes the cookies matching `url` and `name`, `callback` will called with
## Class: WebRequest
The `WebRequest` class allows to intercept and modify contents of a request at
various stages of its lifetime. Instances of `WebRequest` class must be received
by using `webRequest` property of `Session` class.
> Intercept and modify the contents of a request at various stages of its lifetime.
The methods of `WebRequest` accept an optional `filter` and a `listener`, the
Instances of the `WebRequest` class are accessed by using the `webRequest`
property of a `Session`.
The methods of `WebRequest` accept an optional `filter` and a `listener`. The
`listener` will be called with `listener(details)` when the API's event has
happened, the `details` is an object that describes the request. Passing `null`
happened. The `details` object describes the request. Passing `null`
as `listener` will unsubscribe from the event.
The `filter` is an object that has an `urls` property, which is an Array of URL
The `filter` object has a `urls` property which is an Array of URL
patterns that will be used to filter out the requests that do not match the URL
patterns. If the `filter` is omitted then all requests will be matched.
For certain events the `listener` is passed with a `callback`, which should be
called with an `response` object when `listener` has done its work.
called with a `response` object when `listener` has done its work.
An example of adding `User-Agent` header for requests:

View file

@ -29,8 +29,8 @@ console.log(webContents)
### `webContents.getAllWebContents()`
Returns an array of all web contents. This will contain web contents for all
windows, webviews, opened devtools, and devtools extension background pages.
Returns an array of all `WebContents` instances. This will contain web contents
for all windows, webviews, opened devtools, and devtools extension background pages.
### `webContents.getFocusedWebContents()`
@ -39,6 +39,8 @@ returns `null`.
## Class: WebContents
> Render and control the contents of a BrowserWindow instance.
### Instance Events
#### Event: 'did-finish-load'
@ -1161,7 +1163,10 @@ Get the debugger instance for this webContents.
## Class: Debugger
Debugger API serves as an alternate transport for [remote debugging protocol][rdp].
> An alternate transport for Chrome's remote debugging protocol.
Chrome Developer Tools has a [special binding][rdp] available at JavaScript
runtime that allows interacting with pages and instrumenting them.
```javascript
const {BrowserWindow} = require('electron')