| OLD | NEW |
| 1 <p>The downloads API allows you to programmatically initiate, monitor, | 1 <p>The downloads API allows you to programmatically initiate, monitor, |
| 2 manipulate, and search for downloads.</p> | 2 manipulate, and search for downloads.</p> |
| 3 <h2 id='manifest'>Manifest</h2> | 3 <h2 id='manifest'>Manifest</h2> |
| 4 <p> You must declare the 'downloads' permission in the <a | 4 <p> You must declare the 'downloads' permission in the <a |
| 5 href='manifest.html'>extension manifest</a> to use this API, along with <a | 5 href='manifest.html'>extension manifest</a> to use this API, along with <a |
| 6 href='manifest.html#permissions'>host permissions</a> for any hosts that you | 6 href='manifest.html#permissions'>host permissions</a> for any hosts that you |
| 7 may pass to <a href='#method-download'>download()</a>.</p> | 7 may pass to <a href='#method-download'>download()</a>.</p> |
| 8 <pre>{ | 8 <pre>{ |
| 9 'name': 'My extension', | 9 'name': 'My extension', |
| 10 ... | 10 ... |
| 11 <b> 'permissions': [ | 11 <b> 'permissions': [ |
| 12 'downloads', | 12 'downloads', |
| 13 '*://*.google.com' | 13 '*://*.google.com' |
| 14 ]</b>, | 14 ]</b>, |
| 15 ... | 15 ... |
| 16 }</pre> | 16 }</pre> |
| 17 <p>If the URL's hostname is not specified in the permissions, then <a | 17 <p>If the URL's hostname is not specified in the permissions, then <a |
| 18 href='#method-download'>download()</a> will call its callback with a null | 18 href='#method-download'>download()</a> will call its callback with a null |
| 19 <code>downloadId</code> and set the <a | 19 <code>downloadId</code> and set the <a |
| 20 href='extension.html#property-lastError'>chrome.extensions.lastError</a> | 20 href='extension.html#property-lastError'>chrome.extensions.lastError</a> |
| 21 object to indicate that the extension does not have permission to access that | 21 object to indicate that the extension does not have permission to access that |
| 22 hostname.</p> | 22 hostname.</p> |
| 23 <h2 id='examples'>Examples</h2> | 23 <h2 id='examples'>Examples</h2> |
| 24 <p>You can find simple examples of using the downloads module in the <a | 24 <p>You can find simple examples of using the downloads module in the <a |
| 25 href='http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/d
ocs/examples/api/downloads/'>examples/api/downloads</a> | 25 href='http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/d
ocs/examples/api/downloads/'>examples/api/downloads</a> |
| 26 directory. For other examples and for help in viewing the source code, see <a | 26 directory. For other examples and for help in viewing the source code, see <a |
| 27 href='samples.html'>Samples</a>.</p> | 27 href='samples.html'>Samples</a>.</p> |
| OLD | NEW |