Merge pull request #2898 from atom/fix-download-item-doc

Fix inconsistent docs: downloadItem.getURL() => downloadItem.getUrl()
This commit is contained in:
Cheng Zhao 2015-09-25 13:33:49 +08:00
commit 94e5018a47
3 changed files with 4 additions and 4 deletions

View file

@ -30,7 +30,7 @@ struct Converter<content::DownloadItem::DownloadState> {
download_state = "cancelled"; download_state = "cancelled";
break; break;
case content::DownloadItem::INTERRUPTED: case content::DownloadItem::INTERRUPTED:
download_state = "interrputed"; download_state = "interrupted";
break; break;
default: default:
break; break;

View file

@ -39,7 +39,7 @@ Emits when the `downloadItem` gets updated.
* `interrupted` - An error broke the connection with the file server. * `interrupted` - An error broke the connection with the file server.
Emits when the download is in a terminal state. This includes a completed Emits when the download is in a terminal state. This includes a completed
download, a cancelled download(via `downloadItem.cancel()`), and interrputed download, a cancelled download(via `downloadItem.cancel()`), and interrupted
download that can't be resumed. download that can't be resumed.
## Methods ## Methods
@ -66,7 +66,7 @@ Resumes the download that has been paused.
Cancels the download operation. Cancels the download operation.
### `downloadItem.getURL()` ### `downloadItem.getUrl()`
Returns a `String` represents the origin url where the item is downloaded from. Returns a `String` represents the origin url where the item is downloaded from.

View file

@ -28,7 +28,7 @@ Calling `event.preventDefault()` will cancel the download.
```javascript ```javascript
session.on('will-download', function(event, item, webContents) { session.on('will-download', function(event, item, webContents) {
event.preventDefault(); event.preventDefault();
require('request')(item.getURL(), function(data) { require('request')(item.getUrl(), function(data) {
require('fs').writeFileSync('/somewhere', data); require('fs').writeFileSync('/somewhere', data);
}); });
}); });