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

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

Issue 341025: Change the extension.onRequest even to include the sender info. (Closed)
Patch Set: fix args 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
« no previous file with comments | « no previous file | chrome/common/extensions/docs/extension.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 86e42d64cc74c195a28d5cc3861f64ebd11b4c8f..849ddbe62d7f0a2aed558445f445d929c60b09ae 100755
--- a/chrome/common/extensions/api/extension_api.json
+++ b/chrome/common/extensions/api/extension_api.json
@@ -3,6 +3,15 @@
"namespace": "extension",
"types": [
{
+ "id": "MessageSender",
+ "type": "object",
+ "description": "An object containing information about the script context that sent a message or request.",
+ "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."}
+ }
+ },
+ {
"id": "Port",
"type": "object",
"description": "An object which allows two way communication with other pages.",
@@ -12,13 +21,9 @@
"onMessage": {"type": "object"},
"postMessage": {"type": "function"},
"sender": {
- "type": "object",
+ "$ref": "MessageSender",
"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."}
- }
+ "description": "This property will <b>only</b> be present on ports passed to onConnect/onConnectExternal listeners."
}
}
}
@@ -153,8 +158,9 @@
"type": "function",
"description": "Fired when a request is sent from either an extension process or a content script.",
"parameters": [
- { "type": "any", "name": "request" },
- { "type": "function", "name": "sendResponse", "description": "Function to call when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response." }
+ {"name": "request", "type": "any", "description": "The request sent by the calling script."},
+ {"name": "sender", "$ref": "MessageSender" },
+ {"name": "sendResponse", "type": "function", "description": "Function to call when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response." }
]
},
{
@@ -162,8 +168,9 @@
"type": "function",
"description": "Fired when a request is sent from another extension.",
"parameters": [
- { "type": "any", "name": "request" },
- { "type": "function", "name": "sendResponse", "description": "Function to call when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response." }
+ {"name": "request", "type": "any", "description": "The request sent by the calling script."},
+ {"name": "sender", "$ref": "MessageSender" },
+ {"name": "sendResponse", "type": "function", "description": "Function to call when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response." }
]
}
]
« no previous file with comments | « no previous file | chrome/common/extensions/docs/extension.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698