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
3 // found in the LICENSE file.
8 "description": "The <code>chrome.events</code> namespace contains common types used by APIs dispatching events to notify you when something interesting happens.",
10 "implemented_in": "chrome/browser/extensions/api/declarative/declarative_api.h"
16 "description": "Description of a declarative rule for handling events.",
21 "description": "Optional identifier that allows referencing this rule."
25 "items": {"type": "string"},
27 "description": "Tags can be used to annotate rules and perform operations on sets of rules."
31 "items": {"type": "any"},
32 "description": "List of conditions that can trigger the actions."
36 "items": {"type": "any"},
37 "description": "List of actions that are triggered if one of the condtions is fulfilled."
42 "description": "Optional priority of this rule. Defaults to 100."
49 "description": "An object which allows the addition and removal of listeners for a Chrome event.",
50 "additionalProperties": { "type": "any"},
53 "name": "addListener",
56 "description": "Registers an event listener <em>callback</em> to an event.",
61 "description": "Called when an event occurs. The parameters of this function depend on the type of event."
66 "name": "removeListener",
69 "description": "Deregisters an event listener <em>callback</em> from an event.",
74 "description": "Listener that shall be unregistered."
79 "name": "hasListener",
86 "description": "Listener whose registration status shall be tested."
91 "description": "True if <em>callback</em> is registered to the event."
95 "name": "hasListeners",
101 "description": "True if any event listeners are registered to the event."
107 "description": "Registers rules to handle events.",
113 "description": "Name of the event this function affects."
116 "name": "webViewInstanceId",
119 "description": "If provided, this is an integer that uniquely identfies the <webview> associated with this function call."
124 "items": {"$ref": "Rule"},
125 "description": "Rules to be registered. These do not replace previously registered rules."
135 "items": {"$ref": "Rule"},
136 "description": "Rules that were registered, the optional parameters are filled with values."
139 "description": "Called with registered rules."
146 "description": "Returns currently registered rules.",
152 "description": "Name of the event this function affects."
155 "name": "webViewInstanceId",
158 "description": "If provided, this is an integer that uniquely identfies the <webview> associated with this function call."
161 "name": "ruleIdentifiers",
164 "items": {"type": "string"},
165 "description": "If an array is passed, only rules with identifiers contained in this array are returned."
174 "items": {"$ref": "Rule"},
175 "description": "Rules that were registered, the optional parameters are filled with values."
178 "description": "Called with registered rules."
183 "name": "removeRules",
185 "description": "Unregisters currently registered rules.",
191 "description": "Name of the event this function affects."
194 "name": "webViewInstanceId",
197 "description": "If provided, this is an integer that uniquely identfies the <webview> associated with this function call."
200 "name": "ruleIdentifiers",
203 "items": {"type": "string"},
204 "description": "If an array is passed, only rules with identifiers contained in this array are unregistered."
211 "description": "Called when rules were unregistered."
220 "description": "Filters URLs for various criteria. See <a href='#filtered'>event filtering</a>. All criteria are case sensitive.",
225 "description": "Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit 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 components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name.",
230 "description": "Matches if the host name of the URL is equal to a specified string.",
235 "description": "Matches if the host name of the URL starts with a specified string.",
240 "description": "Matches if the host name of the URL ends with a specified string.",
245 "description": "Matches if the path segment of the URL contains a specified string.",
250 "description": "Matches if the path segment of the URL is equal to a specified string.",
255 "description": "Matches if the path segment of the URL starts with a specified string.",
260 "description": "Matches if the path segment of the URL ends with a specified string.",
265 "description": "Matches if the query segment of the URL contains a specified string.",
270 "description": "Matches if the query segment of the URL is equal to a specified string.",
275 "description": "Matches if the query segment of the URL starts with a specified string.",
280 "description": "Matches if the query segment of the URL ends with a specified string.",
285 "description": "Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number.",
290 "description": "Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number.",
295 "description": "Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the <a href=\"http://code.google.com/p/re2/wiki/Syntax\">RE2 syntax</a>.",
298 "originAndPathMatches": {
300 "description": "Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the <a href=\"http://code.google.com/p/re2/wiki/Syntax\">RE2 syntax</a>.",
305 "description": "Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number.",
310 "description": "Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number.",
315 "description": "Matches if the scheme of the URL is equal to any of the schemes specified in the array.",
317 "items": { "type": "string" }
321 "description": "Matches if the port of the URL is contained in any of the specified port lists. For example <code>[80, 443, [1000, 1200]]</code> matches all requests on port 80, 443 and in the range 1000-1200.",
325 {"type": "integer", "description": "A specific port."},
326 {"type": "array", "items": {"type": "integer"}, "description": "A pair of integers identiying the start and end (both inclusive) of a port range."}