OLD | NEW |
| (Empty) |
1 <p>The downloads API allows you to programmatically initiate downloads. In the | |
2 future, you will also be able to monitor and manipulate downloads.</p> | |
3 | |
4 <h2 id="manifest">Manifest</h2> | |
5 | |
6 <p>The downloads API is currently experimental, so you must declare the | |
7 "experimental" permission to use it. Also, you must specify the hostname of any | |
8 URLs to be downloaded. For example:</p> | |
9 | |
10 <pre>{ | |
11 "name": "Download Selected Links", | |
12 "description": "Select links on a page and download them.", | |
13 "version": "0.1", | |
14 "permissions": [ | |
15 "experimental", "http://*/*", "https://*/*" | |
16 ] | |
17 }</pre> | |
18 | |
19 <p>If the URL’s hostname is not specified in the permissions, then | |
20 <a href='extension.html#property-lastError'>chrome.extension.lastError</a> | |
21 will indicate that the extension does not have permission to access that | |
22 hostname. <a href="#properties">downloads.ERROR_*</a> are some of the errors | |
23 that may be returned.</p> | |
24 | |
25 <h2 id="examples"> Examples </h2> | |
26 | |
27 <p>You can find simple examples of using the downloads module in the | |
28 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension
s/docs/examples/api/downloads/">examples/api/downloads</a> | |
29 directory. For other examples and for help in viewing the source code, see | |
30 <a href="samples.html">Samples</a>.</p> | |
31 | |
OLD | NEW |