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": "events", | 7 "namespace": "events", |
8 "compiler_options": { | 8 "compiler_options": { |
9 "implemented_in": "chrome/browser/extensions/api/declarative/declarative_a
pi.h", | 9 "implemented_in": "chrome/browser/extensions/api/declarative/declarative_a
pi.h", |
10 "generate_type_functions": true | 10 "generate_type_functions": true |
11 }, | 11 }, |
12 "internal": true, | 12 "internal": true, |
13 "unprivileged": true, | 13 "unprivileged": true, |
14 "types": [ | 14 "types": [ |
15 { | 15 { |
| 16 "id": "Rule", |
| 17 "type": "object", |
| 18 "description": "Description of a declarative rule for handling events.", |
| 19 "properties": { |
| 20 "id": { |
| 21 "type": "string", |
| 22 "optional": true, |
| 23 "description": "Optional identifier that allows referencing this rul
e." |
| 24 }, |
| 25 "conditions": { |
| 26 "type": "array", |
| 27 "items": {"type": "any"}, |
| 28 "description": "List of conditions that can trigger the actions." |
| 29 }, |
| 30 "actions": { |
| 31 "type": "array", |
| 32 "items": {"type": "any"}, |
| 33 "description": "List of actions that are triggered if one of the con
dtions is fulfilled." |
| 34 }, |
| 35 "priority": { |
| 36 "type": "integer", |
| 37 "optional": true, |
| 38 "description": "Optional priority of this rule. Defaults to 100." |
| 39 } |
| 40 } |
| 41 }, |
| 42 { |
16 "id": "Event", | 43 "id": "Event", |
17 "type": "object", | 44 "type": "object", |
18 "description": "An object which allows the addition and removal of liste
ners for a Chrome event.", | 45 "description": "An object which allows the addition and removal of liste
ners for a Chrome event.", |
19 "additionalProperties": { "type": "any"}, | 46 "additionalProperties": { "type": "any"}, |
20 "functions": [ | 47 "functions": [ |
21 { | 48 { |
22 "name": "addListener", | 49 "name": "addListener", |
23 "nocompile": true, | 50 "nocompile": true, |
24 "type": "function", | 51 "type": "function", |
25 "description": "Registers an event listener <em>callback</em> to an
event.", | 52 "description": "Registers an event listener <em>callback</em> to an
event.", |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 "optional": true, | 186 "optional": true, |
160 "type": "function", | 187 "type": "function", |
161 "parameters": [], | 188 "parameters": [], |
162 "description": "Called when rules were unregistered." | 189 "description": "Called when rules were unregistered." |
163 } | 190 } |
164 ] | 191 ] |
165 } | 192 } |
166 ] | 193 ] |
167 }, | 194 }, |
168 { | 195 { |
169 "id": "Rule", | |
170 "type": "object", | |
171 "description": "Description of a declarative rule for handling events.", | |
172 "properties": { | |
173 "id": { | |
174 "type": "string", | |
175 "optional": true, | |
176 "description": "Optional identifier that allows referencing this rul
e." | |
177 }, | |
178 "conditions": { | |
179 "type": "array", | |
180 "items": {"type": "any"}, | |
181 "description": "List of conditions that can trigger the actions." | |
182 }, | |
183 "actions": { | |
184 "type": "array", | |
185 "items": {"type": "any"}, | |
186 "description": "List of actions that are triggered if one of the con
dtions is fulfilled." | |
187 }, | |
188 "priority": { | |
189 "type": "integer", | |
190 "optional": true, | |
191 "description": "Optional priority of this rule. Defaults to 100." | |
192 } | |
193 } | |
194 }, | |
195 { | |
196 "id": "UrlFilter", | 196 "id": "UrlFilter", |
197 "type": "object", | 197 "type": "object", |
198 "description": "Filters URLs for various criteria. See <a href='#filtere
d'>event filtering</a>. All criteria are case sensitive.", | 198 "description": "Filters URLs for various criteria. See <a href='#filtere
d'>event filtering</a>. All criteria are case sensitive.", |
199 "nocompile": true, | 199 "nocompile": true, |
200 "properties": { | 200 "properties": { |
201 "hostContains": { | 201 "hostContains": { |
202 "type": "string", | 202 "type": "string", |
203 "description": "Matches if the host name of the URL contains a speci
fied string. To test whether a host name component has a prefix 'foo', use hostC
ontains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implici
t dot is added at the beginning of the host name. Similarly, hostContains can be
used to match against component suffix ('foo.') and to exactly match against co
mponents ('.foo.'). Suffix- and exact-matching for the last components need to b
e done separately using hostSuffix, because no implicit dot is added at the end
of the host name.", | 203 "description": "Matches if the host name of the URL contains a speci
fied string. To test whether a host name component has a prefix 'foo', use hostC
ontains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implici
t dot is added at the beginning of the host name. Similarly, hostContains can be
used to match against component suffix ('foo.') and to exactly match against co
mponents ('.foo.'). Suffix- and exact-matching for the last components need to b
e done separately using hostSuffix, because no implicit dot is added at the end
of the host name.", |
204 "optional": true | 204 "optional": true |
205 }, | 205 }, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 {"type": "array", "items": {"type": "integer"}, "description": "
A pair of integers identiying the start and end (both inclusive) of a port range
."} | 299 {"type": "array", "items": {"type": "integer"}, "description": "
A pair of integers identiying the start and end (both inclusive) of a port range
."} |
300 ] | 300 ] |
301 } | 301 } |
302 } | 302 } |
303 } | 303 } |
304 } | 304 } |
305 ] | 305 ] |
306 } | 306 } |
307 ] | 307 ] |
308 | 308 |
OLD | NEW |