Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1625)

Unified Diff: chrome/common/extensions/api/extension_api.json

Issue 262016: Implement chrome.extension.connectExternal and fix various API inconsistencies. (Closed)
Patch Set: addressed comments Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 4ad7e46709d58f76f478ce32bb428d778f5c1ef1..5fe4d222e1798b9c1ad01abc3a5bc1b2923d708b 100755
--- a/chrome/common/extensions/api/extension_api.json
+++ b/chrome/common/extensions/api/extension_api.json
@@ -11,7 +11,15 @@
"onDisconnect": {"type": "object"},
"onMessage": {"type": "object"},
"postMessage": {"type": "function"},
- "tab": {"$ref": "Tab", "optional": true, "description":"This property will <b>only</b> be present on ports passed to onConnect listeners when the connection was opened from a tab or content script."}
+ "sender": {
+ "type": "object",
+ "optional": true,
+ "description": "This property will <b>only</b> be present on ports passed to onConnect/onConnectExternal listeners.",
+ "properties": {
+ "tab": {"$ref": "Tab", "optional": true, "description":"This property will <b>only</b> be present when the connection was opened from a tab or content script."},
+ "id": {"type": "string", "description": "The extension ID of the extension that opened the connection."}
+ }
+ }
}
}
],
@@ -31,6 +39,7 @@
"type": "function",
"description": "Attempts to connect to other listeners within the extension (listeners may be toolstrips or the extension's background page). This is primarily useful for content scripts connecting to their extension processes. Extensions may connect to content scripts embedded in tabs via <a href='broken'><var>chrome.tabs.connectToTab</var></a>.",
"parameters": [
+ {"type": "string", "name": "extensionId", "optional": true, "description": "The extension ID of the extension you want to connect to. If omitted, default is your own extension."},
{
"type": "object",
"name": "connectInfo",
@@ -116,6 +125,14 @@
"parameters": [
{"$ref": "Port", "name": "port"}
]
+ },
+ {
+ "name": "onConnectExternal",
+ "type": "function",
+ "description": "Fired when a connection is made from another extension.",
+ "parameters": [
+ {"$ref": "Port", "name": "port"}
+ ]
}
]
},
« no previous file with comments | « chrome/browser/renderer_host/resource_message_filter.cc ('k') | chrome/common/extensions/docs/extension.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698