OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 [ | 5 [ |
6 { | 6 { |
7 "namespace": "experimental.downloads", | 7 "namespace": "experimental.downloads", |
8 "nodoc": "true", | |
9 "events": [ | 8 "events": [ |
10 { | 9 { |
11 "name": "onCreated", | 10 "name": "onCreated", |
12 "type": "function", | 11 "type": "function", |
| 12 "nodoc": "true", |
13 "description": "This event fires with the DownloadItem object when a dow
nload begins.", | 13 "description": "This event fires with the DownloadItem object when a dow
nload begins.", |
14 "parameters": [ | 14 "parameters": [ |
15 {"name": "downloadItem", "$ref": "DownloadItem"} | 15 {"name": "downloadItem", "$ref": "DownloadItem"} |
16 ] | 16 ] |
17 }, | 17 }, |
18 { | 18 { |
19 "name": "onChanged", | 19 "name": "onChanged", |
20 "type": "function", | 20 "type": "function", |
21 "description": "When any of a DownloadItem's properties except |bytesRec
eived| changes, this event fires with the download id and an object containing t
he properties that changed.", | 21 "nodoc": "true", |
| 22 "description": "When any of a DownloadItem's properties except <code>byt
esReceived</code> changes, this event fires with the download id and an object c
ontaining the properties that changed.", |
22 "parameters": [ | 23 "parameters": [ |
23 {"name": "downloadDelta", "$ref": "DownloadDelta"} | 24 {"name": "downloadDelta", "$ref": "DownloadDelta"} |
24 ] | 25 ] |
25 }, | 26 }, |
26 { | 27 { |
27 "name": "onErased", | 28 "name": "onErased", |
28 "type": "function", | 29 "type": "function", |
| 30 "nodoc": "true", |
29 "description": "Fires with the download id when a download is erased fro
m history.", | 31 "description": "Fires with the download id when a download is erased fro
m history.", |
30 "parameters": [ | 32 "parameters": [ |
31 {"type": "integer", "name": "downloadId"} | 33 {"type": "integer", "name": "downloadId"} |
32 ] | 34 ] |
33 } | 35 } |
34 ], | 36 ], |
35 "properties": { | 37 "properties": { |
36 "STATE_IN_PROGRESS": { | 38 "STATE_IN_PROGRESS": { |
37 "type": "string", | 39 "type": "string", |
| 40 "nodoc": "true", |
38 "value": "in_progress", | 41 "value": "in_progress", |
39 "description": "The download is currently receiving data from the server
." | 42 "description": "The download is currently receiving data from the server
." |
40 }, | 43 }, |
41 "STATE_INTERRUPTED": { | 44 "STATE_INTERRUPTED": { |
42 "type": "string", | 45 "type": "string", |
| 46 "nodoc": "true", |
43 "value": "interrupted", | 47 "value": "interrupted", |
44 "description": "An error broke the connection with the file host." | 48 "description": "An error broke the connection with the file host." |
45 }, | 49 }, |
46 "STATE_COMPLETE": { | 50 "STATE_COMPLETE": { |
47 "type": "string", | 51 "type": "string", |
| 52 "nodoc": "true", |
48 "value": "complete", | 53 "value": "complete", |
49 "description": "The download has completed." | 54 "description": "The download has completed." |
50 }, | 55 }, |
51 "DANGER_SAFE": { | 56 "DANGER_SAFE": { |
52 "type": "string", | 57 "type": "string", |
| 58 "nodoc": "true", |
53 "value": "safe", | 59 "value": "safe", |
54 "description": "The file has been determined to present no known danger
to the user's computer." | 60 "description": "The file has been determined to present no known danger
to the user's computer." |
55 }, | 61 }, |
56 "DANGER_FILE": { | 62 "DANGER_FILE": { |
57 "type": "string", | 63 "type": "string", |
| 64 "nodoc": "true", |
58 "value": "file", | 65 "value": "file", |
59 "description": "The download's filename is suspicious." | 66 "description": "The download's filename is suspicious." |
60 }, | 67 }, |
61 "DANGER_URL": { | 68 "DANGER_URL": { |
62 "type": "string", | 69 "type": "string", |
| 70 "nodoc": "true", |
63 "value": "url", | 71 "value": "url", |
64 "description": "The download's URL is malicious." | 72 "description": "The download's URL is malicious." |
65 }, | 73 }, |
66 "DANGER_CONTENT": { | 74 "DANGER_CONTENT": { |
67 "type": "string", | 75 "type": "string", |
| 76 "nodoc": "true", |
68 "value": "content", | 77 "value": "content", |
69 "description": "The download's content is malicious." | 78 "description": "The download's content is malicious." |
70 }, | 79 }, |
71 "ERROR_GENERIC": { | 80 "ERROR_GENERIC": { |
72 "type": "string", | 81 "type": "string", |
73 "value": "I'm afraid I can't do that.", | 82 "value": "I'm afraid I can't do that.", |
74 "description": "Generic error." | 83 "description": "Generic error." |
75 }, | 84 }, |
76 "ERROR_INVALID_URL": { | 85 "ERROR_INVALID_URL": { |
77 "type": "string", | 86 "type": "string", |
78 "value": "Invalid URL.", | 87 "value": "Invalid URL.", |
79 "description": "The URL was invalid." | 88 "description": "The URL was invalid." |
80 }, | 89 }, |
81 "ERROR_INVALID_OPERATION": { | 90 "ERROR_INVALID_OPERATION": { |
82 "type": "string", | 91 "type": "string", |
| 92 "nodoc": "true", |
83 "value": "Invalid operation.", | 93 "value": "Invalid operation.", |
84 "description": "The requested operation cannot be performed at this time
. This maybe due to the download being in a state where the requested operation
is not allowed." | 94 "description": "The requested operation cannot be performed at this time
. This maybe due to the download being in a state where the requested operation
is not allowed." |
85 } | 95 } |
86 }, | 96 }, |
87 "types": [ | 97 "types": [ |
88 { | 98 { |
89 "id": "HttpHeaders", | 99 "id": "HttpHeaders", |
90 "type": "array", | 100 "type": "array", |
91 "description": "An array of HTTP headers. Each header is represented as
a dictionary containing the keys <code>name</code> and either <code>value</code>
or <code>binaryValue</code>.", | 101 "description": "An array of HTTP headers. Each header is represented as
a dictionary containing the keys <code>name</code> and either <code>value</code>
or <code>binaryValue</code>.", |
92 "items": { | 102 "items": { |
93 "type": "object", | 103 "type": "object", |
94 "properties": { | 104 "properties": { |
95 "name": {"type": "string", "description": "Name of the HTTP header."
}, | 105 "name": {"type": "string", "description": "Name of the HTTP header."
}, |
96 "value": {"type": "string", "optional": true, "description": "Value
of the HTTP header if it can be represented by UTF-8."}, | 106 "value": {"type": "string", "optional": true, "description": "Value
of the HTTP header if it can be represented by UTF-8."}, |
97 "binaryValue": { | 107 "binaryValue": { |
98 "type": "array", | 108 "type": "array", |
99 "optional": true, | 109 "optional": true, |
100 "description": "Value of the HTTP header if it cannot be represent
ed by UTF-8, stored as individual byte values (0..255).", | 110 "description": "Value of the HTTP header if it cannot be represent
ed by UTF-8, stored as individual byte values (0..255).", |
101 "items": {"type": "integer"} | 111 "items": {"type": "integer"} |
102 } | 112 } |
103 } | 113 } |
104 } | 114 } |
105 }, | 115 }, |
106 { | 116 { |
107 "id": "DownloadItem", | 117 "id": "DownloadItem", |
108 "type": "object", | 118 "type": "object", |
| 119 "nodoc": "true", |
109 "description": "The state of a file as it is downloaded from the interne
t.", | 120 "description": "The state of a file as it is downloaded from the interne
t.", |
110 "properties": { | 121 "properties": { |
111 "id": { | 122 "id": { |
112 "type": "integer", | 123 "type": "integer", |
113 "description": "An identifier that is persistent across browser sess
ions." | 124 "description": "An identifier that is persistent across browser sess
ions." |
114 }, | 125 }, |
115 "url": { | 126 "url": { |
116 "type": "string", | 127 "type": "string", |
117 "description": "absolute URL" | 128 "description": "absolute URL" |
118 }, | 129 }, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 "type": "integer", | 177 "type": "integer", |
167 "description": "Number of bytes in the whole file, without consideri
ng file compression, or -1 if unknown." | 178 "description": "Number of bytes in the whole file, without consideri
ng file compression, or -1 if unknown." |
168 }, | 179 }, |
169 "fileSize": { | 180 "fileSize": { |
170 "type": "integer", | 181 "type": "integer", |
171 "description": "Number of bytes in the whole file post-decompression
, or -1 if unknown." | 182 "description": "Number of bytes in the whole file post-decompression
, or -1 if unknown." |
172 } | 183 } |
173 } | 184 } |
174 }, | 185 }, |
175 { | 186 { |
176 "id": "DownloadOptions", | |
177 "type": "object", | |
178 "properties": { | |
179 "url": { | |
180 "type": "string", | |
181 "description": "The URL to download.", | |
182 "minLength": 1 | |
183 }, | |
184 "filename": { | |
185 "type": "string", | |
186 "description": "A file path relative to the Downloads directory to c
ontain the downloaded file.", | |
187 "optional": true | |
188 }, | |
189 "saveAs": { | |
190 "type": "boolean", | |
191 "optional": true, | |
192 "description": "Use a file-chooser to allow the user to select a fil
ename." | |
193 }, | |
194 "method": { | |
195 "type": "string", | |
196 "description": "The HTTP method to use if the URL uses the HTTP[S] p
rotocol.", | |
197 "optional": true, | |
198 "enum": ["GET", "POST"] | |
199 }, | |
200 "headers": { | |
201 "$ref": "HttpHeaders", | |
202 "description": "Extra HTTP headers to send with the request if the U
RL uses the HTTP[s] protocol, restricted to those allowed by XMLHttpRequest.", | |
203 "optional": true | |
204 }, | |
205 "body": { | |
206 "type": "string", | |
207 "description": "post body", | |
208 "optional": true | |
209 } | |
210 } | |
211 }, | |
212 { | |
213 "id": "DownloadQuery", | 187 "id": "DownloadQuery", |
214 "type": "object", | 188 "type": "object", |
| 189 "nodoc": "true", |
215 "description": "", | 190 "description": "", |
216 "properties": { | 191 "properties": { |
217 "query": { | 192 "query": { |
218 "type": "string", | 193 "type": "string", |
219 "description": "This space-separated string of search terms that may
be grouped using quotation marks limits results to downloads whose filename or
url contain all of the search terms that do not begin with a dash ‘-’ and none o
f the search terms that do begin with a dash.", | 194 "description": "This space-separated string of search terms that may
be grouped using quotation marks limits results to downloads whose filename or
url contain all of the search terms that do not begin with a dash ‘-’ and none o
f the search terms that do begin with a dash.", |
220 "optional": true | 195 "optional": true |
221 }, | 196 }, |
222 "startedBefore": { | 197 "startedBefore": { |
223 "type": "integer", | 198 "type": "integer", |
224 "description": "Limits results to downloads that started before the
given ms since the epoch.", | 199 "description": "Limits results to downloads that started before the
given ms since the epoch.", |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 "optional": true | 235 "optional": true |
261 }, | 236 }, |
262 "limit": { | 237 "limit": { |
263 "type": "integer", | 238 "type": "integer", |
264 "optional": true, | 239 "optional": true, |
265 "description": "Setting this integer limits the number of results. O
therwise, all matching DownloadItems will be returned." | 240 "description": "Setting this integer limits the number of results. O
therwise, all matching DownloadItems will be returned." |
266 }, | 241 }, |
267 "orderBy": { | 242 "orderBy": { |
268 "type": "string", | 243 "type": "string", |
269 "optional": true, | 244 "optional": true, |
270 "description": "Setting this string to a DownloadItem property sorts
the DownloadItems prior to applying the above filters. For example, setting |or
derBy|=”startTime” sorts the DownloadItems by their start time in ascending orde
r. To specify descending order, prefix |orderBy| with a hyphen: “-startTime”." | 245 "description": "Setting this string to a DownloadItem property sorts
the DownloadItems prior to applying the above filters. For example, setting <co
de>orderBy=”startTime”</code> sorts the DownloadItems by their start time in asc
ending order. To specify descending order, prefix <code>orderBy</code> with a hy
phen: “-startTime”." |
271 }, | 246 }, |
272 "id": { | 247 "id": { |
273 "type": "integer", | 248 "type": "integer", |
274 "optional": true, | 249 "optional": true, |
275 "description": "An identifier that is persistent across browser sess
ions." | 250 "description": "An identifier that is persistent across browser sess
ions." |
276 }, | 251 }, |
277 "url": { | 252 "url": { |
278 "type": "string", | 253 "type": "string", |
279 "optional": true, | 254 "optional": true, |
280 "description": "absolute URL" | 255 "description": "absolute URL" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 "fileSize": { | 314 "fileSize": { |
340 "type": "integer", | 315 "type": "integer", |
341 "optional": true, | 316 "optional": true, |
342 "description": "Number of bytes in the whole file post-decompression
, or -1 if unknown." | 317 "description": "Number of bytes in the whole file post-decompression
, or -1 if unknown." |
343 } | 318 } |
344 } | 319 } |
345 }, | 320 }, |
346 { | 321 { |
347 "id": "DownloadBooleanDiff", | 322 "id": "DownloadBooleanDiff", |
348 "type": "object", | 323 "type": "object", |
| 324 "nodoc": "true", |
349 "description": "Encapsulates a change in a boolean DownloadItem field.", | 325 "description": "Encapsulates a change in a boolean DownloadItem field.", |
350 "properties": { | 326 "properties": { |
351 "old": { | 327 "old": { |
352 "type": "boolean", | 328 "type": "boolean", |
353 "optional": true | 329 "optional": true |
354 }, | 330 }, |
355 "new": { | 331 "new": { |
356 "type": "boolean", | 332 "type": "boolean", |
357 "optional": true | 333 "optional": true |
358 } | 334 } |
359 } | 335 } |
360 }, | 336 }, |
361 { | 337 { |
362 "id": "DownloadIntegerDiff", | 338 "id": "DownloadIntegerDiff", |
363 "type": "object", | 339 "type": "object", |
| 340 "nodoc": "true", |
364 "description": "Encapsulates a change in an integer DownloadItem field."
, | 341 "description": "Encapsulates a change in an integer DownloadItem field."
, |
365 "properties": { | 342 "properties": { |
366 "old": { | 343 "old": { |
367 "type": "integer", | 344 "type": "integer", |
368 "optional": true | 345 "optional": true |
369 }, | 346 }, |
370 "new": { | 347 "new": { |
371 "type": "integer", | 348 "type": "integer", |
372 "optional": true | 349 "optional": true |
373 } | 350 } |
374 } | 351 } |
375 }, | 352 }, |
376 { | 353 { |
377 "id": "DownloadStringDiff", | 354 "id": "DownloadStringDiff", |
378 "type": "object", | 355 "type": "object", |
| 356 "nodoc": "true", |
379 "description": "Encapsulates a change in a string DownloadItem field.", | 357 "description": "Encapsulates a change in a string DownloadItem field.", |
380 "properties": { | 358 "properties": { |
381 "old": { | 359 "old": { |
382 "type": "string", | 360 "type": "string", |
383 "optional": true | 361 "optional": true |
384 }, | 362 }, |
385 "new": { | 363 "new": { |
386 "type": "string", | 364 "type": "string", |
387 "optional": true | 365 "optional": true |
388 } | 366 } |
389 } | 367 } |
390 }, | 368 }, |
391 { | 369 { |
392 "id": "DownloadDelta", | 370 "id": "DownloadDelta", |
393 "type": "object", | 371 "type": "object", |
| 372 "nodoc": "true", |
394 "description": "Encapsulates a change in a DownloadItem.", | 373 "description": "Encapsulates a change in a DownloadItem.", |
395 "properties": { | 374 "properties": { |
396 "id": { | 375 "id": { |
397 "type": "integer", | 376 "type": "integer", |
398 "description": "An identifier that is persistent across browser sess
ions." | 377 "description": "An identifier that is persistent across browser sess
ions." |
399 }, | 378 }, |
400 "url": { | 379 "url": { |
401 "$ref": "DownloadStringDiff", | 380 "$ref": "DownloadStringDiff", |
402 "optional": true | 381 "optional": true |
403 }, | 382 }, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 }, | 422 }, |
444 "totalBytes": { | 423 "totalBytes": { |
445 "$ref": "DownloadIntegerDiff", | 424 "$ref": "DownloadIntegerDiff", |
446 "optional": true | 425 "optional": true |
447 }, | 426 }, |
448 "fileSize": { | 427 "fileSize": { |
449 "$ref": "DownloadIntegerDiff", | 428 "$ref": "DownloadIntegerDiff", |
450 "optional": true | 429 "optional": true |
451 } | 430 } |
452 } | 431 } |
453 }, | |
454 { | |
455 "id": "DownloadFileIconOptions", | |
456 "type": "object", | |
457 "description": "Options for fetching the file icon for a download. See c
hrome.experimental.downloads.getFileIcon.", | |
458 "properties": { | |
459 "size": { | |
460 "type": "integer", | |
461 "description": "The size of the icon. The returned icon will be squ
are with dimensions size * size pixels. The default size for the icon is 32x32
pixels.", | |
462 "enum": [16, 32], | |
463 "optional": true | |
464 } | |
465 } | |
466 } | 432 } |
467 ], | 433 ], |
468 "functions": [ | 434 "functions": [ |
469 { | 435 { |
470 "name": "download", | 436 "name": "download", |
471 "type": "function", | 437 "type": "function", |
472 "description": "Download a URL. If the URL uses the HTTP[S] protocol, th
en the request will include all cookies currently set for its hostname. If the d
ownload started successfully, |callback| will be called with the new DownloadIte
m’s |id|. If there was an error starting the download, then |callback| will be c
alled with |downloadId|=undefined and chrome.extension.lastError will be set. If
the URL’s hostname is not specified in the |permissions| section of the extensi
on’s manifest, then the |chrome.extensions.lastError| object will indicate that
the extension does not have permission to access that hostname.", | 438 "description": "Download a URL. If the URL uses the HTTP[S] protocol, th
en the request will include all cookies currently set for its hostname. If the d
ownload started successfully, <code>callback</code> will be called with the new
DownloadItem’s <code>downloadId</code>. If there was an error starting the downl
oad, then <code>callback</code> will be called with <code>downloadId=undefined</
code> and <code>chrome.extension.lastError</code> will be set. If both <code>fil
ename</code> and <code>saveAs</code> are specified, then the Save As dialog will
be displayed, pre-populated with the specified <code>filename</code>.", |
473 "parameters": [ | 439 "parameters": [ |
474 {"name": "options", "$ref": "DownloadOptions"}, | |
475 { | 440 { |
| 441 "type": "object", |
| 442 "name": "options", |
| 443 "properties": { |
| 444 "url": { |
| 445 "type": "string", |
| 446 "description": "The URL to download.", |
| 447 "minLength": 1 |
| 448 }, |
| 449 "filename": { |
| 450 "type": "string", |
| 451 "description": "A file path relative to the Downloads directory
to contain the downloaded file.", |
| 452 "optional": true |
| 453 }, |
| 454 "saveAs": { |
| 455 "type": "boolean", |
| 456 "optional": true, |
| 457 "description": "Use a file-chooser to allow the user to select a
filename." |
| 458 }, |
| 459 "method": { |
| 460 "type": "string", |
| 461 "description": "The HTTP method to use if the URL uses the HTTP[
S] protocol.", |
| 462 "optional": true, |
| 463 "enum": ["GET", "POST"] |
| 464 }, |
| 465 "headers": { |
| 466 "$ref": "HttpHeaders", |
| 467 "description": "Extra HTTP headers to send with the request if t
he URL uses the HTTP[s] protocol, restricted to those allowed by XMLHttpRequest.
", |
| 468 "optional": true |
| 469 }, |
| 470 "body": { |
| 471 "type": "string", |
| 472 "description": "post body", |
| 473 "optional": true |
| 474 } |
| 475 } |
| 476 }, |
| 477 { |
| 478 "type": "function", |
476 "name": "callback", | 479 "name": "callback", |
477 "type": "function", | |
478 "optional": true, | 480 "optional": true, |
479 "parameters": [ | 481 "parameters": [ |
480 {"name": "id", "type": "integer"} | 482 { |
| 483 "name": "downloadId", |
| 484 "type": "integer", |
| 485 "description": "If not null, the identifier of the resulting Dow
nload Item." |
| 486 } |
481 ] | 487 ] |
482 } | 488 } |
483 ] | 489 ] |
484 }, | 490 }, |
485 { | 491 { |
486 "name": "search", | 492 "name": "search", |
487 "type": "function", | 493 "type": "function", |
488 "description": "Find DownloadItems. Set |query| to the empty object to g
et all DownloadItems. To get a specific DownloadItem, set only the |id| field.", | 494 "nodoc": "true", |
| 495 "description": "Find DownloadItems. Set <code>query</code> to the empty
object to get all DownloadItems. To get a specific DownloadItem, set only the <c
ode>id</code> field.", |
489 "parameters": [ | 496 "parameters": [ |
490 {"name": "query", "$ref": "DownloadQuery"}, | 497 {"name": "query", "$ref": "DownloadQuery"}, |
491 { | 498 { |
492 "name": "callback", | 499 "name": "callback", |
493 "type": "function", | 500 "type": "function", |
494 "optional": true, | 501 "optional": true, |
495 "parameters": [ | 502 "parameters": [ |
496 {"name": "items", "type": "array"} | 503 {"name": "items", "type": "array"} |
497 ] | 504 ] |
498 } | 505 } |
499 ] | 506 ] |
500 }, | 507 }, |
501 { | 508 { |
502 "name": "erase", | 509 "name": "erase", |
503 "type": "function", | 510 "type": "function", |
| 511 "nodoc": "true", |
504 "description": "Erase matching DownloadItems from history", | 512 "description": "Erase matching DownloadItems from history", |
505 "parameters": [ | 513 "parameters": [ |
506 {"name": "query", "$ref": "DownloadQuery"}, | 514 {"name": "query", "$ref": "DownloadQuery"}, |
507 { | 515 { |
508 "name": "callback", | 516 "name": "callback", |
509 "type": "function", | 517 "type": "function", |
510 "optional": true, | 518 "optional": true, |
511 "parameters": [ | 519 "parameters": [ |
512 {"name": "ids", "type": "array"} | 520 { |
| 521 "name": "ids", |
| 522 "type": "array", |
| 523 "description": "The identifiers of the downloads that were erase
d." |
| 524 } |
513 ] | 525 ] |
514 } | 526 } |
515 ] | 527 ] |
516 }, | 528 }, |
517 { | 529 { |
518 "name": "setDestination", | 530 "name": "setDestination", |
519 "type": "function", | 531 "type": "function", |
520 "description": "Move the file to Downloads/relativePath instead of the D
ownloads directory if it has completed and pass true to callback. If |relativePa
th| specifies a directory that does not exist then it will be created. If it has
not completed, store |relativePath| such that the file will be moved there when
it completes and pass true to callback without waiting for the download to comp
lete. Does nothing if the download is cancelled or if |downloadId| does not refe
rence an existing DownloadItem, but pass false to callback. If the file could no
t be moved, then the DownloadItem will transition to STATE_INTERRUPTED, its |err
or| property will be set accordingly, false will be passed to callback, and the
OnChanged event will fire.", | 532 "nodoc": "true", |
| 533 "description": "Move the file to Downloads/relativePath instead of the D
ownloads directory if it has completed and pass true to callback. If <code>relat
ivePath</code> specifies a directory that does not exist then it will be created
. If it has not completed, store <code>relativePath</code> such that the file wi
ll be moved there when it completes and pass true to callback without waiting fo
r the download to complete. Does nothing if the download is cancelled or if <cod
e>downloadId</code> does not reference an existing DownloadItem, but pass false
to callback. If the file could not be moved, then the DownloadItem will transiti
on to STATE_INTERRUPTED, its <code>error</code> property will be set accordingly
, false will be passed to callback, and the OnChanged event will fire.", |
521 "parameters": [ | 534 "parameters": [ |
522 {"name": "id", "type": "integer"}, | 535 {"name": "id", "type": "integer"}, |
523 {"name": "relativePath", "type": "string"} | 536 {"name": "relativePath", "type": "string"} |
524 ] | 537 ] |
525 }, | 538 }, |
526 { | 539 { |
527 "name": "acceptDanger", | 540 "name": "acceptDanger", |
528 "type": "function", | 541 "type": "function", |
| 542 "nodoc": "true", |
529 "description": "Accept a dangerous download. If a download is dangerous,
then it will not transition to the completed state until this function is calle
d.", | 543 "description": "Accept a dangerous download. If a download is dangerous,
then it will not transition to the completed state until this function is calle
d.", |
530 "parameters": [ | 544 "parameters": [ |
531 {"name": "id", "type": "integer"} | 545 {"name": "id", "type": "integer"} |
532 ] | 546 ] |
533 }, | 547 }, |
534 { | 548 { |
535 "name": "show", | 549 "name": "show", |
536 "type": "function", | 550 "type": "function", |
| 551 "nodoc": "true", |
537 "description": "Show the downloaded file in its folder.", | 552 "description": "Show the downloaded file in its folder.", |
538 "parameters": [ | 553 "parameters": [ |
539 {"name": "id", "type": "integer"} | 554 {"name": "id", "type": "integer"} |
540 ] | 555 ] |
541 }, | 556 }, |
542 { | 557 { |
543 "name": "drag", | 558 "name": "drag", |
544 "type": "function", | 559 "type": "function", |
| 560 "nodoc": "true", |
545 "description": "Drag the file to another application", | 561 "description": "Drag the file to another application", |
546 "parameters": [ | 562 "parameters": [ |
547 {"name": "id", "type": "integer"} | 563 {"name": "id", "type": "integer"} |
548 ] | 564 ] |
549 }, | 565 }, |
550 { | 566 { |
551 "name": "pause", | 567 "name": "pause", |
552 "type": "function", | 568 "type": "function", |
| 569 "nodoc": "true", |
553 "description": "Pause the download.", | 570 "description": "Pause the download.", |
554 "parameters": [ | 571 "parameters": [ |
555 {"name": "id", "type": "integer"}, | 572 {"name": "id", "type": "integer"}, |
556 { | 573 { |
557 "name": "callback", | 574 "name": "callback", |
558 "type": "function", | 575 "type": "function", |
559 "optional": true, | 576 "optional": true, |
560 "parameters": [], | 577 "parameters": [], |
561 "description": "Called when the pause request is completed. If the r
equest was successful the download is in a paused state. Otherwise chrome.extens
ion.lastError contains an error message. The request will fail if the download i
s not active." | 578 "description": "Called when the pause request is completed. If the r
equest was successful the download is in a paused state. Otherwise chrome.extens
ion.lastError contains an error message. The request will fail if the download i
s not active." |
562 } | 579 } |
563 ] | 580 ] |
564 }, | 581 }, |
565 { | 582 { |
566 "name": "resume", | 583 "name": "resume", |
567 "type": "function", | 584 "type": "function", |
| 585 "nodoc": "true", |
568 "description": "Resume a paused download.", | 586 "description": "Resume a paused download.", |
569 "parameters": [ | 587 "parameters": [ |
570 {"name": "id", "type": "integer"}, | 588 {"name": "id", "type": "integer"}, |
571 { | 589 { |
572 "name": "callback", | 590 "name": "callback", |
573 "type": "function", | 591 "type": "function", |
574 "optional": true, | 592 "optional": true, |
575 "parameters": [], | 593 "parameters": [], |
576 "description": "Called when the resume request is completed. If the
request was successful the download is in progress and unpaused. Otherwise chrom
e.extension.lastError contains an error message. The request will fail if the do
wnload is not active." | 594 "description": "Called when the resume request is completed. If the
request was successful the download is in progress and unpaused. Otherwise chrom
e.extension.lastError contains an error message. The request will fail if the do
wnload is not active." |
577 } | 595 } |
578 ] | 596 ] |
579 }, | 597 }, |
580 { | 598 { |
581 "name": "cancel", | 599 "name": "cancel", |
582 "type": "function", | 600 "type": "function", |
| 601 "nodoc": "true", |
583 "description": "Cancel a download.", | 602 "description": "Cancel a download.", |
584 "parameters": [ | 603 "parameters": [ |
585 {"name": "id", "type": "integer"}, | 604 {"name": "id", "type": "integer"}, |
586 { | 605 { |
587 "name": "callback", | 606 "name": "callback", |
588 "type": "function", | 607 "type": "function", |
589 "optional": true, | 608 "optional": true, |
590 "parameters": [], | 609 "parameters": [], |
591 "description": "Called when the request is completed. The download i
s cancelled, completed, interrupted or doesn't exist anymore." | 610 "description": "Called when the request is completed. The download i
s cancelled, completed, interrupted or doesn't exist anymore." |
592 } | 611 } |
593 ] | 612 ] |
594 }, | 613 }, |
595 { | 614 { |
596 "name": "getFileIcon", | 615 "name": "getFileIcon", |
597 "type": "function", | 616 "type": "function", |
| 617 "nodoc": "true", |
598 "description": "Retrieve an icon for the specified download. For new dow
nloads, file icons are available after the onCreated event has been received. Th
e image returned by this function while a download is in progress may be differe
nt from the image returned after the download is complete. Icon retrieval is don
e by querying the underlying operating system or toolkit depending on the platfo
rm. The icon that is returned will therefore depend on a number of factors inclu
ding state of the download, platform, registered file types and visual theme.", | 618 "description": "Retrieve an icon for the specified download. For new dow
nloads, file icons are available after the onCreated event has been received. Th
e image returned by this function while a download is in progress may be differe
nt from the image returned after the download is complete. Icon retrieval is don
e by querying the underlying operating system or toolkit depending on the platfo
rm. The icon that is returned will therefore depend on a number of factors inclu
ding state of the download, platform, registered file types and visual theme.", |
599 "parameters": [ | 619 "parameters": [ |
600 { | 620 { |
| 621 "type": "integer", |
601 "name": "id", | 622 "name": "id", |
602 "type": "integer", | |
603 "description": "The identifier for the download." | 623 "description": "The identifier for the download." |
604 }, | 624 }, |
605 { | 625 { |
| 626 "type": "object", |
606 "name": "options", | 627 "name": "options", |
607 "$ref": "DownloadFileIconOptions", | 628 "properties": { |
608 "description": "Options for the returned image." | 629 "size": { |
| 630 "type": "integer", |
| 631 "description": "The size of the icon. The returned icon will be
square with dimensions size * size pixels. The default size for the icon is 32
x32 pixels.", |
| 632 "enum": [16, 32], |
| 633 "optional": true |
| 634 } |
| 635 } |
609 }, | 636 }, |
610 { | 637 { |
611 "name": "callback", | 638 "name": "callback", |
612 "type": "function", | 639 "type": "function", |
613 "parameters": [ | 640 "parameters": [ |
614 { | 641 { |
615 "name": "iconURL", | 642 "name": "iconURL", |
616 "type": "string", | 643 "type": "string", |
617 "description": "A URL to an image that represents the download.
If a file icon cannot be determined, chrome.extension.lastError will contain an
error message." | 644 "description": "A URL to an image that represents the download.
If a file icon cannot be determined, chrome.extension.lastError will contain an
error message." |
618 } | 645 } |
619 ] | 646 ] |
620 } | 647 } |
621 ] | 648 ] |
622 } | 649 } |
623 ] | 650 ] |
624 } | 651 } |
625 ] | 652 ] |
OLD | NEW |