summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/docs/static/experimental.downloads.html
blob: dc9ab009200f2e87f2b3618c87af77f94d2085cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<p>The downloads API allows you to programmatically initiate downloads. In the
future, you will also be able to monitor and manipulate downloads.</p>

<h2 id="manifest">Manifest</h2>

<p>The downloads API is currently experimental, so you must declare the
"experimental" permission to use it. Also, you must specify the hostname of any
URLs to be downloaded. For example:</p>

<pre>{
  "name": "Download Selected Links",
  "description": "Select links on a page and download them.",
  "version": "0.1",
  "permissions": [
    "experimental", "http://*/*", "https://*/*"
  ]
}</pre>

<p>If the URL’s hostname is not specified in the permissions, then the
chrome.extensions.lastError object will indicate that the extension does not
have permission to access that hostname.
<a href="#properties">downloads.ERROR_*</a> are some of the errors that may be
returned.</p>

<h2 id="examples"> Examples </h2>

<p>You can find simple examples of using the downloads module in the
<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/downloads/">examples/api/downloads</a>
directory. For other examples and for help in viewing the source code, see
<a href="samples.html">Samples</a>.</p>