| 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 6458211d1014ce1ff081bc1d15e3855a3da8283e..aa8e6d8d4339c06b28dd096d4c57d71d04230f41 100644
|
| --- a/chrome/common/extensions/api/extension_api.json
|
| +++ b/chrome/common/extensions/api/extension_api.json
|
| @@ -3009,6 +3009,267 @@
|
| ]
|
| },
|
| {
|
| + "namespace": "experimental.downloads",
|
| + "events": [
|
| + {
|
| + "name": "onCreated",
|
| + "type": "function",
|
| + "unprivileged": true,
|
| + "description": "",
|
| + "parameters": [
|
| + {"$ref": "DownloadItem"}
|
| + ]
|
| + },
|
| + {
|
| + "name": "onChanged",
|
| + "type": "function",
|
| + "unprivileged": true,
|
| + "description": "",
|
| + "parameters": [
|
| + {"$ref": "DownloadDelta"}
|
| + ]
|
| + },
|
| + {
|
| + "name": "onErased",
|
| + "type": "function",
|
| + "unprivileged": true,
|
| + "description": "",
|
| + "parameters": [
|
| + {"type": "integer", "name": "download_id"}
|
| + ]
|
| + }
|
| + ],
|
| + "properties": {
|
| + "STATE_IN_PROGRESS": {
|
| + "type": "string",
|
| + "value": "in progress",
|
| + "description": "The download is currently receiving data from the server."
|
| + },
|
| + "STATE_INTERRUPTED": {
|
| + "type": "string",
|
| + "value": "interrupted",
|
| + "description": "An error broke the connection with the file host."
|
| + },
|
| + "STATE_COMPLETE": {
|
| + "type": "string",
|
| + "value": "complete",
|
| + "description": "The download has completed."
|
| + },
|
| + "DANGER_SAFE": {
|
| + "type": "string",
|
| + "value": "safe",
|
| + "description": "The file has been determined to present no known danger to the user's computer."
|
| + },
|
| + "DANGER_FILE": {
|
| + "type": "string",
|
| + "value": "file",
|
| + "description": "The download's filename is suspicious."
|
| + },
|
| + "DANGER_URL": {
|
| + "type": "string",
|
| + "value": "url",
|
| + "description": "The download's URL is suspicious."
|
| + }
|
| + },
|
| + "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", "enum": ["safe", "file", "url"]},
|
| + "dangerAccepted": {"type": "boolean", "description": "true if the user has accepted the download's danger."},
|
| + "mime": {"type": "string", "description": "The file's MIME type."},
|
| + "startTime": {"type": "integer", "description": "ms since epoch"},
|
| + "endTime": {"type": "integer", "description": "ms since epoch"},
|
| + "state": {"type": "string", "description": "", "enum": ["in progress", "complete", "interrupted"]},
|
| + "paused": {"type": "boolean", "description": "true if the download has stopped reading data"},
|
| + "error": {"type": "integer", "description": "net error code if state is interrupted"},
|
| + "bytesReceived": {"type": "integer", "description": "pre-decompression"},
|
| + "totalBytes": {"type": "integer", "description": "pre-decompression"},
|
| + "fileSize": {"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},
|
| + "saveAs": {"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},
|
| + "startedBefore": {"type": "integer", "description": "ms since epoch", "optional": true},
|
| + "startedAfter": {"type": "integer", "description": "ms since epoch", "optional": true},
|
| + "endedBefore": {"type": "integer", "description": "ms since epoch", "optional": true},
|
| + "endedAfter": {"type": "integer", "description": "ms since epoch", "optional": true},
|
| + "totalBytesGreater": {"type": "integer", "description": "", "optional": true},
|
| + "totalBytesLess": {"type": "integer", "description": "", "optional": true},
|
| + "filenameRegex": {"type": "string", "description": "", "optional": true},
|
| + "urlRegex": {"type": "string", "description": "", "optional": true},
|
| + "limit": {"type": "integer", "optional": true, "description": ""},
|
| + "orderBy": {"type": "string", "optional": true, "description": ""},
|
| + "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, "enum": ["safe", "file", "url"]},
|
| + "dangerAccepted": {"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},
|
| + "startTime": {"type": "integer", "description": "ms since epoch", "optional": true},
|
| + "endTime": {"type": "integer", "description": "ms since epoch", "optional": true},
|
| + "state": {"type": "string", "description": "", "optional": true, "enum": ["in progress", "complete", "interrupted"]},
|
| + "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},
|
| + "bytesReceived": {"type": "integer", "description": "pre-decompression", "optional": true},
|
| + "totalBytes": {"type": "integer", "description": "pre-decompression", "optional": true},
|
| + "fileSize": {"type": "integer", "description": "post-decompression", "optional": true}
|
| + }
|
| + },
|
| + {
|
| + "id": "DownloadIntegerDiff",
|
| + "type": "object",
|
| + "description": "",
|
| + "properties": {
|
| + }
|
| + },
|
| + {
|
| + "id": "DownloadDelta",
|
| + "type": "object",
|
| + "description": "",
|
| + "properties": {
|
| + }
|
| + },
|
| + {
|
| + "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": "setDestination",
|
| + "type": "function",
|
| + "description": "Move a downloaded file",
|
| + "parameters": [
|
| + {"name": "id", "type": "integer"},
|
| + {"name": "path", "type": "string"}
|
| + ]
|
| + },
|
| + {
|
| + "name": "acceptDanger",
|
| + "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": [],
|
|
|