OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 [ | 5 [ |
6 { | 6 { |
7 "namespace": "extension", | 7 "namespace": "extension", |
8 "nocompile": true, | 8 "nocompile": true, |
9 "dependencies": [ "tabs" ], | 9 "dependencies": [ "events", "tabs" ], |
10 "types": [ | 10 "types": [ |
11 { | 11 { |
12 "id": "MessageSender", | 12 "id": "MessageSender", |
13 "type": "object", | 13 "type": "object", |
14 "description": "An object containing information about the script contex
t that sent a message or request.", | 14 "description": "An object containing information about the script contex
t that sent a message or request.", |
15 "properties": { | 15 "properties": { |
16 "tab": {"$ref": "tabs.Tab", "optional": true, "description":"This prop
erty will <b>only</b> be present when the connection was opened from a tab or co
ntent script."}, | 16 "tab": {"$ref": "tabs.Tab", "optional": true, "description":"This prop
erty will <b>only</b> be present when the connection was opened from a tab or co
ntent script."}, |
17 "id": {"type": "string", "description": "The extension ID of the exten
sion that opened the connection."} | 17 "id": {"type": "string", "description": "The extension ID of the exten
sion that opened the connection."} |
18 } | 18 } |
19 }, | 19 }, |
20 { | 20 { |
21 "id": "Event", | |
22 "type": "object", | |
23 "description": "An object which allows the addition and removal of liste
ners for a Chrome event.", | |
24 "properties": { | |
25 "addListener": {"type": "function"}, | |
26 "removeListener": {"type": "function"}, | |
27 "hasListener": {"type": "function"}, | |
28 "hasListeners": {"type": "function"} | |
29 }, | |
30 "additionalProperties": { "type": "any"} | |
31 }, | |
32 { | |
33 "id": "Port", | 21 "id": "Port", |
34 "type": "object", | 22 "type": "object", |
35 "description": "An object which allows two way communication with other
pages.", | 23 "description": "An object which allows two way communication with other
pages.", |
36 "properties": { | 24 "properties": { |
37 "name": {"type": "string"}, | 25 "name": {"type": "string"}, |
38 "onDisconnect": { "$ref": "Event" }, | 26 "onDisconnect": { "$ref": "events.Event" }, |
39 "onMessage": { "$ref": "Event" }, | 27 "onMessage": { "$ref": "events.Event" }, |
40 "postMessage": {"type": "function"}, | 28 "postMessage": {"type": "function"}, |
41 "sender": { | 29 "sender": { |
42 "$ref": "MessageSender", | 30 "$ref": "MessageSender", |
43 "optional": true, | 31 "optional": true, |
44 "description": "This property will <b>only</b> be present on ports p
assed to onConnect/onConnectExternal listeners." | 32 "description": "This property will <b>only</b> be present on ports p
assed to onConnect/onConnectExternal listeners." |
45 } | 33 } |
46 }, | 34 }, |
47 "additionalProperties": { "type": "any"} | 35 "additionalProperties": { "type": "any"} |
48 } | 36 } |
49 ], | 37 ], |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 ], | 325 ], |
338 "returns": { | 326 "returns": { |
339 "type": "boolean", | 327 "type": "boolean", |
340 "optional": "true", | 328 "optional": "true", |
341 "description": "Return true from the event listener if you wish to cal
l <code>sendResponse</code> after the event listener returns." | 329 "description": "Return true from the event listener if you wish to cal
l <code>sendResponse</code> after the event listener returns." |
342 } | 330 } |
343 } | 331 } |
344 ] | 332 ] |
345 } | 333 } |
346 ] | 334 ] |
OLD | NEW |