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

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

Issue 9965005: Deprecate chrome.extension.sendRequest in favor of sendMessage, with a safer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better docs Created 8 years, 9 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/tabs.json
diff --git a/chrome/common/extensions/api/tabs.json b/chrome/common/extensions/api/tabs.json
index 299d3a37ec05186a612161cdcc267476e232d188..9ceba2dd002eea63860295801d2aa088daf1ed2b 100644
--- a/chrome/common/extensions/api/tabs.json
+++ b/chrome/common/extensions/api/tabs.json
@@ -94,7 +94,7 @@
"name": "sendRequest",
"nocompile": true,
"type": "function",
- "description": "Sends a single request to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The <a href='extension.html#event-onRequest'>chrome.extension.onRequest</a> event is fired in each content script running in the specified tab for the current extension.",
+ "description": "Deprecated: Please use sendMessage.",
"parameters": [
{
"type": "integer",
@@ -120,6 +120,35 @@
]
},
{
+ "name": "sendMessage",
+ "nocompile": true,
+ "type": "function",
+ "description": "Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The <a href='extension.html#event-onMessage'>chrome.extension.onMessage</a> event is fired in each content script running in the specified tab for the current extension.",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0
+ },
+ {
+ "type": "any",
+ "name": "message"
+ },
+ {
+ "type": "function",
+ "name": "responseCallback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "response",
+ "type": "any",
+ "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and <a href='extension.html#property-lastError'>chrome.extension.lastError</a> will be set to the error message."
+ }
+ ]
+ }
+ ]
+ },
+ {
"name": "getSelected",
"nodoc": true,
"type": "function",

Powered by Google App Engine
This is Rietveld 408576698