Chromium Code Reviews| 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 ]}</pre> | |
|
mkearney
2012/03/13 17:51:51
Very small comment to move } down a line. It looks
benjhayden
2012/03/13 18:16:13
Done.
| |
| 17 | |
| 18 <p>If the URL’s hostname is not specified in the permissions, then the | |
| 19 chrome.extensions.lastError object will indicate that the extension does not | |
| 20 have permission to access that hostname. | |
| 21 <a href="#properties">downloads.ERROR_*</a> are some of the errors that may be | |
| 22 returned.</p> | |
| 23 | |
| 24 <h2 id="examples"> Examples </h2> | |
| 25 | |
| 26 <p>You can find simple examples of using the downloads module in the | |
| 27 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension s/docs/examples/api/downloads/">examples/api/downloads</a> | |
| 28 directory. For other examples and for help in viewing the source code, see | |
| 29 <a href="samples.html">Samples</a>.</p> | |
| 30 | |
| OLD | NEW |