diff --git a/readme.md b/readme.md index 644e037..88a58d3 100644 --- a/readme.md +++ b/readme.md @@ -303,6 +303,7 @@ chrome.registerPlugin(new CookiePlugin()); * [chrome.declarativeContent](https://developer.chrome.com/extensions/declarativeContent) * [chrome.desktopCapture](https://developer.chrome.com/extensions/desktopCapture) * [chrome.devtools](https://developer.chrome.com/extensions/devtools) +* [chrome.dial](https://chromium.googlesource.com/chromium/src.git/+/master/chrome/common/extensions/api/dial.idl) (undocumented API for communication with DIAL-capable devices) * [chrome.downloads](https://developer.chrome.com/extensions/downloads) * [chrome.extension](https://developer.chrome.com/extensions/extension) * [chrome.extensionTypes](https://developer.chrome.com/extensions/extensionTypes) diff --git a/src/config/stable-api.json b/src/config/stable-api.json index bcaf1b4..5809c7a 100644 --- a/src/config/stable-api.json +++ b/src/config/stable-api.json @@ -3894,6 +3894,139 @@ "manifest:devtools_page" ] }, + { + "types": [ + { + "id": "DialDevice", + "type": "object", + "properties": { + "deviceLabel": { + "type": "string" + }, + "deviceDescriptionUrl": { + "type": "string" + }, + "configId": { + "type": "integer", + "nullable": true + } + } + }, + { + "id": "DialDeviceDescription", + "type": "object", + "properties": { + "deviceLabel": { + "type": "string" + }, + "appUrl": { + "type": "string" + }, + "deviceDescription": { + "type": "string" + } + } + }, + { + "id": "DialErrorCode", + "type": "string", + "enum": [ + "no_listeners", + "no_valid_network_interfaces", + "network_disconnected", + "cellular_network", + "socket_error", + "unknown" + ] + }, + { + "id": "DialError", + "type": "object", + "properties": { + "code": { + "$ref": "DialErrorCode" + } + } + } + ], + "functions": [ + { + "name": "discoverNow", + "type": "function", + "parameters": [ + { + "optional": false, + "name": "callback", + "type": "function", + "parameters": [ + { + "type": "boolean", + "optional": false, + "name": "result" + } + ] + } + ], + "static": true + }, + { + "name": "fetchDeviceDescription", + "type": "function", + "parameters": [ + { + "type": "string", + "optional": false, + "name": "deviceLabel" + }, + { + "optional": false, + "name": "callback", + "type": "function", + "parameters": [ + { + "$ref": "DialDeviceDescription", + "optional": false, + "name": "result" + } + ] + } + ], + "static": true + } + ], + "events": [ + { + "name": "onDeviceList", + "type": "function", + "parameters": [ + { + "type": "array", + "items": { + "$ref": "DialDevice" + }, + "optional": false, + "name": "result" + } + ] + }, + { + "name": "onError", + "type": "function", + "parameters": [ + { + "$ref": "DialError", + "optional": false, + "name": "error" + } + ] + } + ], + "namespace": "dial", + "description": "Use the chrome.dial API to discover devices that support DIAL. Protocol specification: http://www.dial-multiscreen.org/", + "dependencies": [ + "permission:dial" + ] + }, { "types": [ { diff --git a/test/config.js b/test/config.js index 1a0992b..ac995f6 100644 --- a/test/config.js +++ b/test/config.js @@ -345,6 +345,17 @@ export default { 'onSelectionChanged' ] }, + dial: { + methods: [ + 'discoverNow', + 'fetchDeviceDescription' + ], + properties: [], + events: [ + 'onDeviceList', + 'onError' + ] + }, downloads: { methods: [ 'download',