| Index: chrome/common/extensions/api/extension_api.json
|
| diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json
|
| index 1613b9053703ece72a046054c8a6f05fad42fed3..3b07aa06a9355e8fb74724fdfbdd81041860840e 100644
|
| --- a/chrome/common/extensions/api/extension_api.json
|
| +++ b/chrome/common/extensions/api/extension_api.json
|
| @@ -2864,6 +2864,190 @@
|
| ]
|
| },
|
| {
|
| + "namespace": "experimental.downloads",
|
| + "types": [
|
| + {
|
| + "id": "DownloadItem",
|
| + "type": "object",
|
| + "description": "The state of a downloading file.",
|
| + "properties": {
|
| + "id": {"type": "integer", "description": "A persistent identifier"},
|
| + "url": {"type": "string", "description": "absolute URL"},
|
| + "filename": {"type": "string", "description": "absolute local path"},
|
| + "danger": {"type": "string", "description": "Safety"},
|
| + "danger_accepted": {"type": "boolean", "description": "true if the user has accepted the download's danger."},
|
| + "mime": {"type": "string", "description": "The file's MIME type."},
|
| + "start_time": {"type": "integer", "description": "ms since epoch"},
|
| + "end_time": {"type": "integer", "description": "ms since epoch"},
|
| + "state": {"type": "string", "description": "in_progress, complete, or interrupted"},
|
| + "paused": {"type": "boolean", "description": "true if the download has stopped reading data"},
|
| + "error": {"type": "integer", "description": "net error code if state is interrupted"},
|
| + "bytes_received": {"type": "integer", "description": "pre-decompression"},
|
| + "total_bytes": {"type": "integer", "description": "pre-decompression"},
|
| + "file_size": {"type": "integer", "description": "post-decompression"}
|
| + }
|
| + },
|
| + {
|
| + "id": "DownloadOptions",
|
| + "type": "object",
|
| + "properties": {
|
| + "url": {"type": "string", "description": "The URL to download."},
|
| + "filename": {"type": "string", "description": "relative local path", "optional": true},
|
| + "save_as": {"type": "boolean", "optional": true, "description": "Show the Save File As dialog."},
|
| + "method": {"type": "string", "description": "GET or POST", "optional": true},
|
| + "headers": {"type": "object", "description": "request headers", "optional": true, "properties": {}, "additionalProperties": { "type": "any" }},
|
| + "body": {"type": "string", "description": "post body", "optional": true}
|
| + }
|
| + },
|
| + {
|
| + "id": "DownloadQuery",
|
| + "type": "object",
|
| + "description": "",
|
| + "properties": {
|
| + "query": {"type": "string", "description": "boolean search terms", "optional": true},
|
| + "started_before": {"type": "integer", "description": "ms since epoch", "optional": true},
|
| + "started_after": {"type": "integer", "description": "ms since epoch", "optional": true},
|
| + "ended_before": {"type": "integer", "description": "ms since epoch", "optional": true},
|
| + "ended_after": {"type": "integer", "description": "ms since epoch", "optional": true},
|
| + "total_bytes_greater": {"type": "integer", "description": "", "optional": true},
|
| + "total_bytes_less": {"type": "integer", "description": "", "optional": true},
|
| + "filename_re": {"type": "string", "description": "", "optional": true},
|
| + "url_re": {"type": "string", "description": "", "optional": true},
|
| + "id": {"type": "integer", "description": "A persistent identifier", "optional": true},
|
| + "url": {"type": "string", "description": "absolute URL", "optional": true},
|
| + "filename": {"type": "string", "description": "absolute local path", "optional": true},
|
| + "danger": {"type": "string", "description": "Safety", "optional": true},
|
| + "danger_accepted": {"type": "boolean", "description": "true if the user has accepted the download's danger.", "optional": true},
|
| + "mime": {"type": "string", "description": "The file's MIME type.", "optional": true},
|
| + "start_time": {"type": "integer", "description": "ms since epoch", "optional": true},
|
| + "end_time": {"type": "integer", "description": "ms since epoch", "optional": true},
|
| + "state": {"type": "string", "description": "in_progress, complete, or interrupted", "optional": true},
|
| + "paused": {"type": "boolean", "description": "true if the download has stopped reading data", "optional": true},
|
| + "error": {"type": "integer", "description": "net error code if state is interrupted", "optional": true},
|
| + "bytes_received": {"type": "integer", "description": "pre-decompression", "optional": true},
|
| + "total_bytes": {"type": "integer", "description": "pre-decompression", "optional": true},
|
| + "file_size": {"type": "integer", "description": "post-decompression", "optional": true}
|
| + }
|
| + },
|
| + {
|
| + "id": "DownloadResponse",
|
| + "type": "object",
|
| + "description": "Result of download()",
|
| + "properties": {
|
| + "id": {"type": "integer", "optional": true},
|
| + "error": {"type": "integer", "optional": true}
|
| + }
|
| + }
|
| + ],
|
| + "functions": [
|
| + {
|
| + "name": "download",
|
| + "type": "function",
|
| + "description": "Download a URL.",
|
| + "parameters": [
|
| + {"$ref": "DownloadOptions"},
|
| + {
|
| + "name": "callback",
|
| + "type": "function",
|
| + "optional": true,
|
| + "parameters": [
|
| + {"$ref": "DownloadResponse"}
|
| + ]
|
| + }
|
| + ]
|
| + },
|
| + {
|
| + "name": "search",
|
| + "type": "function",
|
| + "description": "Find DownloadItems",
|
| + "parameters": [
|
| + {"$ref": "DownloadQuery"},
|
| + {
|
| + "name": "callback",
|
| + "type": "function",
|
| + "optional": true,
|
| + "parameters": [
|
| + {"name": "items", "type": "array"}
|
| + ]
|
| + }
|
| + ]
|
| + },
|
| + {
|
| + "name": "erase",
|
| + "type": "function",
|
| + "description": "Erase DownloadItems from history",
|
| + "parameters": [
|
| + {"$ref": "DownloadQuery"},
|
| + {
|
| + "name": "callback",
|
| + "type": "function",
|
| + "optional": true,
|
| + "parameters": [
|
| + {"name": "ids", "type": "array"}
|
| + ]
|
| + }
|
| + ]
|
| + },
|
| + {
|
| + "name": "set_destination",
|
| + "type": "function",
|
| + "description": "Move a downloaded file",
|
| + "parameters": [
|
| + {"name": "id", "type": "integer"},
|
| + {"name": "path", "type": "string"}
|
| + ]
|
| + },
|
| + {
|
| + "name": "accept_danger",
|
| + "type": "function",
|
| + "description": "Accept a dangerous download",
|
| + "parameters": [
|
| + {"name": "id", "type": "integer"}
|
| + ]
|
| + },
|
| + {
|
| + "name": "show",
|
| + "type": "function",
|
| + "description": "Show in folder",
|
| + "parameters": [
|
| + {"name": "id", "type": "integer"}
|
| + ]
|
| + },
|
| + {
|
| + "name": "drag",
|
| + "type": "function",
|
| + "description": "Drag the file to another application",
|
| + "parameters": [
|
| + {"name": "id", "type": "integer"}
|
| + ]
|
| + },
|
| + {
|
| + "name": "pause",
|
| + "type": "function",
|
| + "description": "Pause the download",
|
| + "parameters": [
|
| + {"name": "id", "type": "integer"}
|
| + ]
|
| + },
|
| + {
|
| + "name": "resume",
|
| + "type": "function",
|
| + "description": "Resume a paused download",
|
| + "parameters": [
|
| + {"name": "id", "type": "integer"}
|
| + ]
|
| + },
|
| + {
|
| + "name": "cancel",
|
| + "type": "function",
|
| + "description": "Cancel a download",
|
| + "parameters": [
|
| + {"name": "id", "type": "integer"}
|
| + ]
|
| + }
|
| + ]
|
| + },
|
| + {
|
| "namespace": "devtools",
|
| "nodoc": "true",
|
| "types": [],
|
|
|