OLD | NEW |
| (Empty) |
1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc.
Note: | |
2 1) The <head> information in this page is significant, should be uniform | |
3 across api docs and should be edited only with knowledge of the | |
4 templating mechanism. | |
5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a | |
6 browser, it will be re-generated from the template, json schema and | |
7 authored overview content. | |
8 4) The <body>.innerHTML is also generated by an offline step so that this | |
9 page may easily be indexed by search engines. | |
10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> | |
11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> | |
13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> | |
14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla
te_compiled.js"> | |
15 </script> | |
16 <script type="text/javascript" src="../../../../third_party/json_minify/mini
fy-sans-regexp.js"> | |
17 </script> | |
18 <script type="text/javascript" src="js/api_page_generator.js"></script> | |
19 <script type="text/javascript" src="js/bootstrap.js"></script> | |
20 <script type="text/javascript" src="js/sidebar.js"></script> | |
21 <meta name="description" content="Documentation for the chrome.events module,
which is part of the Google Chrome extension APIs."><title>chrome.events - Goog
le Chrome Extensions - Google Code</title></head> | |
22 <body> <div id="devModeWarning" class="displayModeWarning"> | |
23 You are viewing extension docs in chrome via the 'file:' scheme: are you exp
ecting to see local changes when you refresh? You'll need run chrome with --allo
w-file-access-from-files. | |
24 </div> | |
25 <div id="branchWarning" class="displayModeWarning"> | |
26 <span>WARNING: This is the <span id="branchName">BETA</span> documentation. | |
27 It may not work with the stable release of Chrome.</span> | |
28 <select id="branchChooser"> | |
29 <option>Choose a different version... | |
30 </option><option value="">Stable | |
31 </option><option value="beta">Beta | |
32 </option><option value="dev">Dev | |
33 </option><option value="trunk">Trunk | |
34 </option></select> | |
35 </div> | |
36 <div id="unofficialWarning" class="displayModeWarning"> | |
37 <span>WARNING: This is unofficial documentation. It may not work with the | |
38 current release of Chrome.</span> | |
39 <button id="goToOfficialDocs">Go to the official docs</button> | |
40 </div> | |
41 <div id="gc-container" class="labs"> | |
42 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> | |
43 <!-- In particular, sub-templates that recurse, must be used by allowing | |
44 jstemplate to make a copy of the template in this section which | |
45 are not operated on by way of the jsskip="true" --> | |
46 <!-- /SUBTEMPLATES --> | |
47 <a id="top"></a> | |
48 <div id="skipto"> | |
49 <a href="#gc-pagecontent">Skip to page content</a> | |
50 <a href="#gc-toc">Skip to main navigation</a> | |
51 </div> | |
52 <!-- API HEADER --> | |
53 <table id="header" width="100%" cellspacing="0" border="0"> | |
54 <tbody><tr> | |
55 <td valign="middle"><a href="http://code.google.com/"><img src="images/c
ode_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border:
0; margin:0;"></a></td> | |
56 <td valign="middle" width="100%" style="padding-left:0.6em;"> | |
57 <form action="http://www.google.com/cse" id="cse" style="margin-top:0.
5em"> | |
58 <div id="gsc-search-box"> | |
59 <input type="hidden" name="cx" value="002967670403910741006:61_cvz
fqtno"> | |
60 <input type="hidden" name="ie" value="UTF-8"> | |
61 <input type="text" name="q" value="" size="55"> | |
62 <input class="gsc-search-button" type="submit" name="sa" value="Se
arch"> | |
63 <br> | |
64 <span class="greytext">e.g. "page action" or "tabs"</span> | |
65 </div> | |
66 </form> | |
67 <script type="text/javascript" src="https://www.google.com/jsapi"></sc
ript> | |
68 <script type="text/javascript">google.load("elements", "1", {packages:
"transliteration"});</script> | |
69 <script type="text/javascript" src="https://www.google.com/coop/cse/t1
3n?form=cse&t13n_langs=en"></script> | |
70 <script type="text/javascript" src="https://www.google.com/coop/cse/br
and?form=cse&lang=en"></script> | |
71 </td> | |
72 </tr> | |
73 </tbody></table> | |
74 <div id="codesiteContent" class=""> | |
75 <a id="gc-topnav-anchor"></a> | |
76 <div id="gc-topnav"> | |
77 <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Lab
s</a>)</h1> | |
78 <ul id="home" class="gc-topnav-tabs"> | |
79 <li id="home_link"> | |
80 <a href="index.html" title="Google Chrome Extensions home page">Home
</a> | |
81 </li> | |
82 <li id="docs_link"> | |
83 <a href="docs.html" title="Official Google Chrome Extensions documen
tation">Docs</a> | |
84 </li> | |
85 <li id="faq_link"> | |
86 <a href="faq.html" title="Answers to frequently asked questions abou
t Google Chrome Extensions">FAQ</a> | |
87 </li> | |
88 <li id="samples_link"> | |
89 <a href="samples.html" title="Sample extensions (with source code)">
Samples</a> | |
90 </li> | |
91 <li id="group_link"> | |
92 <a href="http://groups.google.com/a/chromium.org/group/chromium-exte
nsions" title="Google Chrome Extensions developer forum">Group</a> | |
93 </li> | |
94 <li id="so_link"> | |
95 <a href="http://stackoverflow.com/questions/tagged/google-chrome-ext
ension" title="[google-chrome-extension] tag on Stack Overflow">Questions?</a> | |
96 </li> | |
97 </ul> | |
98 </div> <!-- end gc-topnav --> | |
99 <div class="g-section g-tpl-170"> | |
100 <!-- SIDENAV --> | |
101 <div class="g-unit g-first" id="gc-toc"> | |
102 <ul> | |
103 <li><a href="getstarted.html">Getting Started</a></li> | |
104 <li><a href="overview.html">Overview</a></li> | |
105 <li><a href="whats_new.html">What's New?</a></li> | |
106 <li><h2><a href="devguide.html">Developer's Guide</a></h2> | |
107 <ul> | |
108 <li>Browser UI | |
109 <ul> | |
110 <li><a href="browserAction.html">Browser Actions</a></li> | |
111 <li><a href="contextMenus.html">Context Menus</a></li> | |
112 <li><a href="notifications.html">Desktop Notifications</a></li
> | |
113 <li><a href="omnibox.html">Omnibox</a></li> | |
114 <li><a href="options.html">Options Pages</a></li> | |
115 <li><a href="override.html">Override Pages</a></li> | |
116 <li><a href="pageAction.html">Page Actions</a></li> | |
117 </ul> | |
118 </li> | |
119 <li>Browser Interaction | |
120 <ul> | |
121 <li><a href="bookmarks.html">Bookmarks</a></li> | |
122 <li><a href="cookies.html">Cookies</a></li> | |
123 <li><a href="devtools.html">Developer Tools</a></li> | |
124 <li class="leftNavSelected">Events</li> | |
125 <li><a href="history.html">History</a></li> | |
126 <li><a href="management.html">Management</a></li> | |
127 <li><a href="tabs.html">Tabs</a></li> | |
128 <li><a href="windows.html">Windows</a></li> | |
129 </ul> | |
130 </li> | |
131 <li>Implementation | |
132 <ul> | |
133 <li><a href="a11y.html">Accessibility</a></li> | |
134 <li><a href="background_pages.html">Background Pages</a></li> | |
135 <li><a href="content_scripts.html">Content Scripts</a></li> | |
136 <li><a href="xhr.html">Cross-Origin XHR</a></li> | |
137 <li><a href="i18n.html">Internationalization</a></li> | |
138 <li><a href="messaging.html">Message Passing</a></li> | |
139 <li><a href="permissions.html">Optional Permissions</a></li> | |
140 <li><a href="npapi.html">NPAPI Plugins</a></li> | |
141 </ul> | |
142 </li> | |
143 <li>Finishing | |
144 <ul> | |
145 <li><a href="hosting.html">Hosting</a></li> | |
146 <li><a href="external_extensions.html">Other Deployment Option
s</a></li> | |
147 </ul> | |
148 </li> | |
149 </ul> | |
150 </li> | |
151 <li><h2><a href="apps.html">Packaged Apps</a></h2></li> | |
152 <li><h2><a href="tutorials.html">Tutorials</a></h2> | |
153 <ul> | |
154 <li><a href="tut_debugging.html">Debugging</a></li> | |
155 <li><a href="tut_analytics.html">Google Analytics</a></li> | |
156 <li><a href="tut_oauth.html">OAuth</a></li> | |
157 </ul> | |
158 </li> | |
159 <li><h2>Reference</h2> | |
160 <ul> | |
161 <li>Formats | |
162 <ul> | |
163 <li><a href="manifest.html">Manifest Files</a></li> | |
164 <li><a href="match_patterns.html">Match Patterns</a></li> | |
165 </ul> | |
166 </li> | |
167 <li><a href="permission_warnings.html">Permission Warnings</a></li
> | |
168 <li><a href="api_index.html">chrome.* APIs</a></li> | |
169 <li><a href="api_other.html">Other APIs</a></li> | |
170 </ul> | |
171 </li> | |
172 <li><h2><a href="samples.html">Samples</a></h2></li> | |
173 <div class="line"> </div> | |
174 <li><h2>More</h2> | |
175 <ul> | |
176 <li><a href="http://code.google.com/chrome/webstore/docs/index.htm
l">Chrome Web Store</a></li> | |
177 <li><a href="http://code.google.com/chrome/apps/docs/developers_gu
ide.html">Hosted Apps</a></li> | |
178 <li><a href="themes.html">Themes</a></li> | |
179 </ul> | |
180 </li> | |
181 </ul> | |
182 </div> | |
183 <script> | |
184 initToggles(); | |
185 </script> | |
186 <div class="g-unit" id="gc-pagecontent"> | |
187 <div id="pageTitle"> | |
188 <h1 class="page_title">chrome.events</h1> | |
189 </div> | |
190 <!-- TABLE OF CONTENTS --> | |
191 <div id="toc"> | |
192 <h2>Contents</h2> | |
193 <ol> | |
194 <li> | |
195 <a href="#declarative">Declarative Event Handlers</a> | |
196 <ol> | |
197 <li> | |
198 <a href="#rules">Rules</a> | |
199 </li><li> | |
200 <a href="#eventobjects">Event objects</a> | |
201 </li><li> | |
202 <a href="#addingrules">Adding rules</a> | |
203 </li><li> | |
204 <a href="#removingrules">Removing rules</a> | |
205 </li><li> | |
206 <a href="#retrievingrules">Retrieving rules</a> | |
207 </li> | |
208 </ol> | |
209 </li> | |
210 <li> | |
211 <a href="#apiReference">API reference: chrome.events</a> | |
212 <ol> | |
213 <li> | |
214 <a href="#types">Types</a> | |
215 <ol> | |
216 <li> | |
217 <a href="#type-Event">Event</a> | |
218 <ol> | |
219 <li> | |
220 <a href="#global-Event-methods">Methods</a> | |
221 <ol> | |
222 <li> | |
223 <a href="#method-Event-addListener">addListener</a> | |
224 </li><li> | |
225 <a href="#method-Event-addRules">addRules</a> | |
226 </li><li> | |
227 <a href="#method-Event-getRules">getRules</a> | |
228 </li><li> | |
229 <a href="#method-Event-hasListener">hasListener</a> | |
230 </li><li> | |
231 <a href="#method-Event-hasListeners">hasListeners</a> | |
232 </li><li> | |
233 <a href="#method-Event-removeListener">removeListener</a> | |
234 </li><li> | |
235 <a href="#method-Event-removeRules">removeRules</a> | |
236 </li> | |
237 </ol> | |
238 </li> | |
239 </ol> | |
240 </li><li> | |
241 <a href="#type-Rule">Rule</a> | |
242 <ol> | |
243 </ol> | |
244 </li><li> | |
245 <a href="#type-UrlFilter">UrlFilter</a> | |
246 <ol> | |
247 </ol> | |
248 </li> | |
249 </ol> | |
250 </li> | |
251 </ol> | |
252 </li> | |
253 </ol> | |
254 </div> | |
255 <!-- /TABLE OF CONTENTS --> | |
256 <!-- Standard content lead-in for experimental API pages --> | |
257 <!-- STATIC CONTENT PLACEHOLDER --> | |
258 <div id="static"><p> | |
259 An <code>Event</code> is an object | |
260 that allows you to be notified | |
261 when something interesting happens. | |
262 Here's an example of using the | |
263 <code>chrome.tabs.onCreated</code> event | |
264 to be notified whenever there's a new tab: | |
265 </p> | |
266 <pre>chrome.tabs.onCreated.<b>addListener(function(</b>tab<b>) {</b> | |
267 appendToLog('tabs.onCreated --' | |
268 + ' window: ' + tab.windowId | |
269 + ' tab: ' + tab.id | |
270 + ' index: ' + tab.index | |
271 + ' url: ' + tab.url); | |
272 <b>});</b> | |
273 </pre> | |
274 <p> | |
275 As the example shows, | |
276 you register for notification using <code>addListener()</code>. | |
277 The argument to <code>addListener()</code> | |
278 is always a function that you define to handle the event, | |
279 but the parameters to the function depend on | |
280 which event you're handling. | |
281 Checking the documentation for | |
282 <a href="tabs.html#event-onCreated"><code>chrome.tabs.onCreated</code></a>, | |
283 you can see that the function has a single parameter: | |
284 a <a href="tabs.html#type-Tab">Tab</a> object | |
285 that has details about the newly created tab. | |
286 </p> | |
287 <h2 id="declarative">Declarative Event Handlers</h2> | |
288 <p> | |
289 The declarative event handlers provide a means to define rules consisting of | |
290 declarative conditions and actions. Conditions are evaluated in the browser | |
291 rather than the JavaScript engine which reduces roundtrip latencies and allows | |
292 for very high efficiency. | |
293 </p> | |
294 <p>Declarative event handlers are used for example in the <a href="declarativeWe
bRequest.html">Declarative Web Request API</a> and possibly | |
295 further extension APIs in the future. This page describes the underlying | |
296 concepts of all declarative event handlers. | |
297 </p> | |
298 <h3 id="rules">Rules</h3> | |
299 <p>The simplest possible rule consists of one or more conditions and one or more | |
300 actions:</p> | |
301 <pre>var rule = { | |
302 conditions: [ /* my conditions */ ], | |
303 actions: [ /* my actions */ ] | |
304 }; | |
305 </pre> | |
306 <p>If any of the conditions is fulfilled, all actions are executed.</p> | |
307 <p>In addition to conditions and actions you may give each rule an identifier, | |
308 which simplifies unregistering previously registered rules, and a priority to | |
309 define precedences among rules. Priorities are only considered if rules conflict | |
310 each other or need to be executed in a specific order.</p> | |
311 <pre>var rule = { | |
312 id: "my rule", // optional, will be generated if not set. | |
313 priority: 100, // optional, defaults to 100. | |
314 conditions: [ /* my conditions */ ], | |
315 actions: [ /* my actions */ ] | |
316 }; | |
317 </pre> | |
318 <h3 id="eventobjects">Event objects</h3> | |
319 <p> | |
320 <a href="events.html">Event objects</a> may support rules. These event objects | |
321 don't call a callback function when events happer but test whether any | |
322 registered rule has at least one fulfilled condition and execute the actions | |
323 associated with this rule. Event objects supporting the declarative API have | |
324 three relevant methods: <a href="#method-addRules"><code>addRules()</code></a>, | |
325 <a href="#method-removeRules"><code>removeRules()</code></a>, and | |
326 <a href="#method-getRules"><code>getRules()</code></a>. | |
327 </p> | |
328 <h3 id="addingrules">Adding rules</h3> | |
329 <p> | |
330 To add rules call the <code>addRules()</code> function of the event object. It | |
331 takes an array of rule instances as its first parameter and a callback function | |
332 that is called on completion. | |
333 </p> | |
334 <pre>var rule_list = [rule1, rule2, ...]; | |
335 function addRules(rule_list, function callback(details) {...}); | |
336 </pre> | |
337 <p> | |
338 If the rules were inserted successfully, the <code>details</code> parameter | |
339 contains an array of inserted rules appearing in the same order as in the passed | |
340 <code>rule_list</code> where the optional parameters <code>id</code> and | |
341 <code>priority</code> were filled with the generated values. If any rule is | |
342 invalid, e.g., because it contained an invalid condition or action, none of the | |
343 rules are added and the <a href="extension.html#property-lastError">lastError</a
> variable is set when | |
344 the callback function is called. Each rule in <code>rule_list</code> must | |
345 contain a unique identifier that is not currently used by another rule or an | |
346 empty identifier. | |
347 </p> | |
348 <h3 id="removingrules">Removing rules</h3> | |
349 <p> | |
350 To remove rules call the <code>removeRules()</code> function. It accepts an | |
351 optional array of rule identifiers as its first parameter and a callback | |
352 function as its second parameter. | |
353 </p> | |
354 <pre>var rule_ids = ["id1", "id2", ...]; | |
355 function removeRules(rule_ids, function callback() {...}); | |
356 </pre> | |
357 <p> | |
358 If <code>rule_ids</code> is an array of identifiers, all rules having | |
359 identifiers listed in the array are removed. If <code>rule_ids</code> lists an | |
360 identifier, that is unknown, this identifier is silently ignored. If | |
361 <code>rule_ids</code> is <code>undefined</code>, all registered rules of this | |
362 extension are removed. The <code>callback()</code> function is called when the | |
363 rules were removed. | |
364 </p> | |
365 <h3 id="retrievingrules">Retrieving rules</h3> | |
366 <p> | |
367 To retrieve a list of currently registered rules, call the | |
368 <code>getRules()</code> function. It accepts an optional array of rule | |
369 identifiers with the same semantics as <code>removeRules</code> and a callback | |
370 function. | |
371 </p><p> | |
372 </p><pre>var rule_ids = ["id1", "id2", ...]; | |
373 function getRules(rule_ids, function callback(details) {...}); | |
374 </pre> | |
375 <p> | |
376 The <code>details</code> parameter passed to the <code>calback()</code> function | |
377 refers to an array of rules including filled optional parameters. | |
378 </p> | |
379 </div> | |
380 <!-- API PAGE --> | |
381 <div class="apiPage"> | |
382 <a name="apiReference"></a> | |
383 <h2>API reference: chrome.events</h2> | |
384 <!-- PROPERTIES --> | |
385 <!-- /apiGroup --> | |
386 <!-- METHODS --> | |
387 <!-- /apiGroup --> | |
388 <!-- EVENTS --> | |
389 <!-- /apiGroup --> | |
390 <!-- TYPES --> | |
391 <div class="apiGroup"> | |
392 <a name="types"></a> | |
393 <h3 id="types">Types</h3> | |
394 <!-- iterates over all types --> | |
395 <div class="apiItem"> | |
396 <a name="type-Event"></a> | |
397 <h4>Event</h4> | |
398 <div> | |
399 <dt> | |
400 <em> | |
401 <!-- TYPE --> | |
402 <div style="display:inline"> | |
403 ( | |
404 <span id="typeTemplate"> | |
405 <span> | |
406 <span>object</span> | |
407 </span> | |
408 </span> | |
409 ) | |
410 </div> | |
411 </em> | |
412 </dt> | |
413 <dd>An object which allows the addition and removal of listeners for a
Chrome event.</dd> | |
414 <!-- OBJECT PROPERTIES --> | |
415 <!-- OBJECT METHODS --> | |
416 <dd> | |
417 <div class="apiGroup"> | |
418 <a name="global-Event-methods"></a> | |
419 <h3>Methods of Event</h3> | |
420 <!-- iterates over all functions --> | |
421 <div class="apiItem"> | |
422 <a name="method-Event-addListener"></a> <!-- method-anchor --> | |
423 <h4>addListener</h4> | |
424 <div class="summary"> | |
425 <!-- Note: intentionally longer 80 columns --> | |
426 <span>event.addListener</span>(<span class="null"><span>functi
on</span> | |
427 <var><span>callback</span></var></span>)</div> | |
428 <div class="description"> | |
429 <p>Registers an event listener <em>callback</em> to an event.</p
> | |
430 <!-- PARAMETERS --> | |
431 <h4>Parameters</h4> | |
432 <dl> | |
433 <div> | |
434 <div> | |
435 <dt> | |
436 <var>callback</var> | |
437 <em> | |
438 <!-- TYPE --> | |
439 <div style="display:inline"> | |
440 ( | |
441 <span id="typeTemplate"> | |
442 <span> | |
443 <span>function</span> | |
444 </span> | |
445 </span> | |
446 ) | |
447 </div> | |
448 </em> | |
449 </dt> | |
450 <dd>Called when an event occurs. The parameters of this function depen
d on the type of event.</dd> | |
451 <!-- OBJECT PROPERTIES --> | |
452 <!-- OBJECT METHODS --> | |
453 <!-- OBJECT EVENT FIELDS --> | |
454 <!-- FUNCTION PARAMETERS --> | |
455 </div> | |
456 </div> | |
457 </dl> | |
458 <!-- RETURNS --> | |
459 <dl> | |
460 </dl> | |
461 <!-- CALLBACK --> | |
462 <!-- MIN_VERSION --> | |
463 </div> <!-- /description --> | |
464 </div><div class="apiItem"> | |
465 <a name="method-Event-addRules"></a> <!-- method-anchor --> | |
466 <h4>addRules</h4> | |
467 <div class="summary"> | |
468 <!-- Note: intentionally longer 80 columns --> | |
469 <span>event.addRules</span>(<span class="null"><span>array of
Rule</span> | |
470 <var><span>rules</span></var></span><span class="optional"
><span>, </span><span>function</span> | |
471 <var><span>callback</span></var></span>)</div> | |
472 <div class="description"> | |
473 <p>Registers rules to handle events.</p> | |
474 <!-- PARAMETERS --> | |
475 <h4>Parameters</h4> | |
476 <dl> | |
477 <div> | |
478 <div> | |
479 <dt> | |
480 <var>rules</var> | |
481 <em> | |
482 <!-- TYPE --> | |
483 <div style="display:inline"> | |
484 ( | |
485 <span id="typeTemplate"> | |
486 <span> | |
487 <span> | |
488 array of <span><span> | |
489 <span> | |
490 <a href="events.html#type-Rule">Rule</a> | |
491 </span> | |
492 </span></span> | |
493 </span> | |
494 </span> | |
495 </span> | |
496 ) | |
497 </div> | |
498 </em> | |
499 </dt> | |
500 <dd>Rules to be registered. These do not replace previously registered
rules.</dd> | |
501 <!-- OBJECT PROPERTIES --> | |
502 <!-- OBJECT METHODS --> | |
503 <!-- OBJECT EVENT FIELDS --> | |
504 <!-- FUNCTION PARAMETERS --> | |
505 </div> | |
506 </div><div> | |
507 <div> | |
508 <dt> | |
509 <var>callback</var> | |
510 <em> | |
511 <!-- TYPE --> | |
512 <div style="display:inline"> | |
513 ( | |
514 <span class="optional">optional</span> | |
515 <span id="typeTemplate"> | |
516 <span> | |
517 <span>function</span> | |
518 </span> | |
519 </span> | |
520 ) | |
521 </div> | |
522 </em> | |
523 </dt> | |
524 <dd>Called with registered rules.</dd> | |
525 <!-- OBJECT PROPERTIES --> | |
526 <!-- OBJECT METHODS --> | |
527 <!-- OBJECT EVENT FIELDS --> | |
528 <!-- FUNCTION PARAMETERS --> | |
529 </div> | |
530 </div> | |
531 </dl> | |
532 <!-- RETURNS --> | |
533 <dl> | |
534 </dl> | |
535 <!-- CALLBACK --> | |
536 <div> | |
537 <div> | |
538 <h4>Callback function</h4> | |
539 <p> | |
540 If you specify the <em>callback</em> parameter, it should | |
541 specify a function that looks like this: | |
542 </p> | |
543 <!-- Note: intentionally longer 80 columns --> | |
544 <pre>function(<span>array of Rule rules</span>) <span class="s
ubdued">{...}</span>;</pre> | |
545 <dl> | |
546 <div> | |
547 <div> | |
548 <dt> | |
549 <var>rules</var> | |
550 <em> | |
551 <!-- TYPE --> | |
552 <div style="display:inline"> | |
553 ( | |
554 <span id="typeTemplate"> | |
555 <span> | |
556 <span> | |
557 array of <span><span> | |
558 <span> | |
559 <a href="events.html#type-Rule">Rule</a> | |
560 </span> | |
561 </span></span> | |
562 </span> | |
563 </span> | |
564 </span> | |
565 ) | |
566 </div> | |
567 </em> | |
568 </dt> | |
569 <dd>Rules that were registered, the optional parameters are filled wit
h values.</dd> | |
570 <!-- OBJECT PROPERTIES --> | |
571 <!-- OBJECT METHODS --> | |
572 <!-- OBJECT EVENT FIELDS --> | |
573 <!-- FUNCTION PARAMETERS --> | |
574 </div> | |
575 </div> | |
576 </dl> | |
577 </div> | |
578 </div> | |
579 <!-- MIN_VERSION --> | |
580 </div> <!-- /description --> | |
581 </div><div class="apiItem"> | |
582 <a name="method-Event-getRules"></a> <!-- method-anchor --> | |
583 <h4>getRules</h4> | |
584 <div class="summary"> | |
585 <!-- Note: intentionally longer 80 columns --> | |
586 <span>event.getRules</span>(<span class="optional"><span>array
of string</span> | |
587 <var><span>ruleIdentifiers</span></var></span><span class=
"null"><span>, </span><span>function</span> | |
588 <var><span>callback</span></var></span>)</div> | |
589 <div class="description"> | |
590 <p>Returns currently registered rules.</p> | |
591 <!-- PARAMETERS --> | |
592 <h4>Parameters</h4> | |
593 <dl> | |
594 <div> | |
595 <div> | |
596 <dt> | |
597 <var>ruleIdentifiers</var> | |
598 <em> | |
599 <!-- TYPE --> | |
600 <div style="display:inline"> | |
601 ( | |
602 <span class="optional">optional</span> | |
603 <span id="typeTemplate"> | |
604 <span> | |
605 <span> | |
606 array of <span><span> | |
607 <span> | |
608 <span>string</span> | |
609 </span> | |
610 </span></span> | |
611 </span> | |
612 </span> | |
613 </span> | |
614 ) | |
615 </div> | |
616 </em> | |
617 </dt> | |
618 <dd>If an array is passed, only rules with identifiers contained in th
is array are returned.</dd> | |
619 <!-- OBJECT PROPERTIES --> | |
620 <!-- OBJECT METHODS --> | |
621 <!-- OBJECT EVENT FIELDS --> | |
622 <!-- FUNCTION PARAMETERS --> | |
623 </div> | |
624 </div><div> | |
625 <div> | |
626 <dt> | |
627 <var>callback</var> | |
628 <em> | |
629 <!-- TYPE --> | |
630 <div style="display:inline"> | |
631 ( | |
632 <span id="typeTemplate"> | |
633 <span> | |
634 <span>function</span> | |
635 </span> | |
636 </span> | |
637 ) | |
638 </div> | |
639 </em> | |
640 </dt> | |
641 <dd>Called with registered rules.</dd> | |
642 <!-- OBJECT PROPERTIES --> | |
643 <!-- OBJECT METHODS --> | |
644 <!-- OBJECT EVENT FIELDS --> | |
645 <!-- FUNCTION PARAMETERS --> | |
646 </div> | |
647 </div> | |
648 </dl> | |
649 <!-- RETURNS --> | |
650 <dl> | |
651 </dl> | |
652 <!-- CALLBACK --> | |
653 <div> | |
654 <div> | |
655 <h4>Callback function</h4> | |
656 <p> | |
657 The <em>callback</em> parameter should specify a function | |
658 that looks like this: | |
659 </p> | |
660 <!-- Note: intentionally longer 80 columns --> | |
661 <pre>function(<span>array of Rule rules</span>) <span class="s
ubdued">{...}</span>;</pre> | |
662 <dl> | |
663 <div> | |
664 <div> | |
665 <dt> | |
666 <var>rules</var> | |
667 <em> | |
668 <!-- TYPE --> | |
669 <div style="display:inline"> | |
670 ( | |
671 <span id="typeTemplate"> | |
672 <span> | |
673 <span> | |
674 array of <span><span> | |
675 <span> | |
676 <a href="events.html#type-Rule">Rule</a> | |
677 </span> | |
678 </span></span> | |
679 </span> | |
680 </span> | |
681 </span> | |
682 ) | |
683 </div> | |
684 </em> | |
685 </dt> | |
686 <dd>Rules that were registered, the optional parameters are filled wit
h values.</dd> | |
687 <!-- OBJECT PROPERTIES --> | |
688 <!-- OBJECT METHODS --> | |
689 <!-- OBJECT EVENT FIELDS --> | |
690 <!-- FUNCTION PARAMETERS --> | |
691 </div> | |
692 </div> | |
693 </dl> | |
694 </div> | |
695 </div> | |
696 <!-- MIN_VERSION --> | |
697 </div> <!-- /description --> | |
698 </div><div class="apiItem"> | |
699 <a name="method-Event-hasListener"></a> <!-- method-anchor --> | |
700 <h4>hasListener</h4> | |
701 <div class="summary"><span>boolean</span> | |
702 <!-- Note: intentionally longer 80 columns --> | |
703 <span>event.hasListener</span>(<span class="null"><span>functi
on</span> | |
704 <var><span>callback</span></var></span>)</div> | |
705 <div class="description"> | |
706 <!-- PARAMETERS --> | |
707 <h4>Parameters</h4> | |
708 <dl> | |
709 <div> | |
710 <div> | |
711 <dt> | |
712 <var>callback</var> | |
713 <em> | |
714 <!-- TYPE --> | |
715 <div style="display:inline"> | |
716 ( | |
717 <span id="typeTemplate"> | |
718 <span> | |
719 <span>function</span> | |
720 </span> | |
721 </span> | |
722 ) | |
723 </div> | |
724 </em> | |
725 </dt> | |
726 <dd>Listener whose registration status shall be tested.</dd> | |
727 <!-- OBJECT PROPERTIES --> | |
728 <!-- OBJECT METHODS --> | |
729 <!-- OBJECT EVENT FIELDS --> | |
730 <!-- FUNCTION PARAMETERS --> | |
731 </div> | |
732 </div> | |
733 </dl> | |
734 <!-- RETURNS --> | |
735 <h4>Returns</h4> | |
736 <dl> | |
737 <div> | |
738 <div> | |
739 <dt> | |
740 <em> | |
741 <!-- TYPE --> | |
742 <div style="display:inline"> | |
743 ( | |
744 <span id="typeTemplate"> | |
745 <span> | |
746 <span>boolean</span> | |
747 </span> | |
748 </span> | |
749 ) | |
750 </div> | |
751 </em> | |
752 </dt> | |
753 <dd>True if <em>callback</em> is registered to the event.</dd> | |
754 <!-- OBJECT PROPERTIES --> | |
755 <!-- OBJECT METHODS --> | |
756 <!-- OBJECT EVENT FIELDS --> | |
757 <!-- FUNCTION PARAMETERS --> | |
758 </div> | |
759 </div> | |
760 </dl> | |
761 <!-- CALLBACK --> | |
762 <!-- MIN_VERSION --> | |
763 </div> <!-- /description --> | |
764 </div><div class="apiItem"> | |
765 <a name="method-Event-hasListeners"></a> <!-- method-anchor --> | |
766 <h4>hasListeners</h4> | |
767 <div class="summary"><span>boolean</span> | |
768 <!-- Note: intentionally longer 80 columns --> | |
769 <span>event.hasListeners</span>()</div> | |
770 <div class="description"> | |
771 <!-- PARAMETERS --> | |
772 <dl> | |
773 </dl> | |
774 <!-- RETURNS --> | |
775 <h4>Returns</h4> | |
776 <dl> | |
777 <div> | |
778 <div> | |
779 <dt> | |
780 <em> | |
781 <!-- TYPE --> | |
782 <div style="display:inline"> | |
783 ( | |
784 <span id="typeTemplate"> | |
785 <span> | |
786 <span>boolean</span> | |
787 </span> | |
788 </span> | |
789 ) | |
790 </div> | |
791 </em> | |
792 </dt> | |
793 <dd>True if any event listeners are registered to the event.</dd> | |
794 <!-- OBJECT PROPERTIES --> | |
795 <!-- OBJECT METHODS --> | |
796 <!-- OBJECT EVENT FIELDS --> | |
797 <!-- FUNCTION PARAMETERS --> | |
798 </div> | |
799 </div> | |
800 </dl> | |
801 <!-- CALLBACK --> | |
802 <!-- MIN_VERSION --> | |
803 </div> <!-- /description --> | |
804 </div><div class="apiItem"> | |
805 <a name="method-Event-removeListener"></a> <!-- method-anchor --> | |
806 <h4>removeListener</h4> | |
807 <div class="summary"> | |
808 <!-- Note: intentionally longer 80 columns --> | |
809 <span>event.removeListener</span>(<span class="null"><span>fun
ction</span> | |
810 <var><span>callback</span></var></span>)</div> | |
811 <div class="description"> | |
812 <p>Deregisters an event listener <em>callback</em> from an event
.</p> | |
813 <!-- PARAMETERS --> | |
814 <h4>Parameters</h4> | |
815 <dl> | |
816 <div> | |
817 <div> | |
818 <dt> | |
819 <var>callback</var> | |
820 <em> | |
821 <!-- TYPE --> | |
822 <div style="display:inline"> | |
823 ( | |
824 <span id="typeTemplate"> | |
825 <span> | |
826 <span>function</span> | |
827 </span> | |
828 </span> | |
829 ) | |
830 </div> | |
831 </em> | |
832 </dt> | |
833 <dd>Listener that shall be unregistered.</dd> | |
834 <!-- OBJECT PROPERTIES --> | |
835 <!-- OBJECT METHODS --> | |
836 <!-- OBJECT EVENT FIELDS --> | |
837 <!-- FUNCTION PARAMETERS --> | |
838 </div> | |
839 </div> | |
840 </dl> | |
841 <!-- RETURNS --> | |
842 <dl> | |
843 </dl> | |
844 <!-- CALLBACK --> | |
845 <!-- MIN_VERSION --> | |
846 </div> <!-- /description --> | |
847 </div><div class="apiItem"> | |
848 <a name="method-Event-removeRules"></a> <!-- method-anchor --> | |
849 <h4>removeRules</h4> | |
850 <div class="summary"> | |
851 <!-- Note: intentionally longer 80 columns --> | |
852 <span>event.removeRules</span>(<span class="optional"><span>ar
ray of string</span> | |
853 <var><span>ruleIdentifiers</span></var></span><span class=
"optional"><span>, </span><span>function</span> | |
854 <var><span>callback</span></var></span>)</div> | |
855 <div class="description"> | |
856 <p>Unregisters currently registered rules.</p> | |
857 <!-- PARAMETERS --> | |
858 <h4>Parameters</h4> | |
859 <dl> | |
860 <div> | |
861 <div> | |
862 <dt> | |
863 <var>ruleIdentifiers</var> | |
864 <em> | |
865 <!-- TYPE --> | |
866 <div style="display:inline"> | |
867 ( | |
868 <span class="optional">optional</span> | |
869 <span id="typeTemplate"> | |
870 <span> | |
871 <span> | |
872 array of <span><span> | |
873 <span> | |
874 <span>string</span> | |
875 </span> | |
876 </span></span> | |
877 </span> | |
878 </span> | |
879 </span> | |
880 ) | |
881 </div> | |
882 </em> | |
883 </dt> | |
884 <dd>If an array is passed, only rules with identifiers contained in th
is array are unregistered.</dd> | |
885 <!-- OBJECT PROPERTIES --> | |
886 <!-- OBJECT METHODS --> | |
887 <!-- OBJECT EVENT FIELDS --> | |
888 <!-- FUNCTION PARAMETERS --> | |
889 </div> | |
890 </div><div> | |
891 <div> | |
892 <dt> | |
893 <var>callback</var> | |
894 <em> | |
895 <!-- TYPE --> | |
896 <div style="display:inline"> | |
897 ( | |
898 <span class="optional">optional</span> | |
899 <span id="typeTemplate"> | |
900 <span> | |
901 <span>function</span> | |
902 </span> | |
903 </span> | |
904 ) | |
905 </div> | |
906 </em> | |
907 </dt> | |
908 <dd>Called when rules were unregistered.</dd> | |
909 <!-- OBJECT PROPERTIES --> | |
910 <!-- OBJECT METHODS --> | |
911 <!-- OBJECT EVENT FIELDS --> | |
912 <!-- FUNCTION PARAMETERS --> | |
913 </div> | |
914 </div> | |
915 </dl> | |
916 <!-- RETURNS --> | |
917 <dl> | |
918 </dl> | |
919 <!-- CALLBACK --> | |
920 <div> | |
921 <div> | |
922 <h4>Callback function</h4> | |
923 <p> | |
924 If you specify the <em>callback</em> parameter, it should | |
925 specify a function that looks like this: | |
926 </p> | |
927 <!-- Note: intentionally longer 80 columns --> | |
928 <pre>function(<span></span>) <span class="subdued">{...}</span
>;</pre> | |
929 <dl> | |
930 </dl> | |
931 </div> | |
932 </div> | |
933 <!-- MIN_VERSION --> | |
934 </div> <!-- /description --> | |
935 </div> <!-- /apiItem --> | |
936 </div> | |
937 </dd> | |
938 <!-- OBJECT EVENT FIELDS --> | |
939 <!-- FUNCTION PARAMETERS --> | |
940 </div> | |
941 </div><div class="apiItem"> | |
942 <a name="type-Rule"></a> | |
943 <h4>Rule</h4> | |
944 <div> | |
945 <dt> | |
946 <em> | |
947 <!-- TYPE --> | |
948 <div style="display:inline"> | |
949 ( | |
950 <span id="typeTemplate"> | |
951 <span> | |
952 <span>object</span> | |
953 </span> | |
954 </span> | |
955 ) | |
956 </div> | |
957 </em> | |
958 </dt> | |
959 <dd>Description of a declarative rule for handling events.</dd> | |
960 <!-- OBJECT PROPERTIES --> | |
961 <dd> | |
962 <dl> | |
963 <div> | |
964 <div> | |
965 <dt> | |
966 <var>id</var> | |
967 <em> | |
968 <!-- TYPE --> | |
969 <div style="display:inline"> | |
970 ( | |
971 <span class="optional">optional</span> | |
972 <span id="typeTemplate"> | |
973 <span> | |
974 <span>string</span> | |
975 </span> | |
976 </span> | |
977 ) | |
978 </div> | |
979 </em> | |
980 </dt> | |
981 <dd>Optional identifier that allows referencing this rule.</dd> | |
982 <!-- OBJECT PROPERTIES --> | |
983 <!-- OBJECT METHODS --> | |
984 <!-- OBJECT EVENT FIELDS --> | |
985 <!-- FUNCTION PARAMETERS --> | |
986 </div> | |
987 </div><div> | |
988 <div> | |
989 <dt> | |
990 <var>conditions</var> | |
991 <em> | |
992 <!-- TYPE --> | |
993 <div style="display:inline"> | |
994 ( | |
995 <span id="typeTemplate"> | |
996 <span> | |
997 <span> | |
998 array of <span><span> | |
999 <span> | |
1000 <span>any</span> | |
1001 </span> | |
1002 </span></span> | |
1003 </span> | |
1004 </span> | |
1005 </span> | |
1006 ) | |
1007 </div> | |
1008 </em> | |
1009 </dt> | |
1010 <dd>List of conditions that can trigger the actions.</dd> | |
1011 <!-- OBJECT PROPERTIES --> | |
1012 <!-- OBJECT METHODS --> | |
1013 <!-- OBJECT EVENT FIELDS --> | |
1014 <!-- FUNCTION PARAMETERS --> | |
1015 </div> | |
1016 </div><div> | |
1017 <div> | |
1018 <dt> | |
1019 <var>actions</var> | |
1020 <em> | |
1021 <!-- TYPE --> | |
1022 <div style="display:inline"> | |
1023 ( | |
1024 <span id="typeTemplate"> | |
1025 <span> | |
1026 <span> | |
1027 array of <span><span> | |
1028 <span> | |
1029 <span>any</span> | |
1030 </span> | |
1031 </span></span> | |
1032 </span> | |
1033 </span> | |
1034 </span> | |
1035 ) | |
1036 </div> | |
1037 </em> | |
1038 </dt> | |
1039 <dd>List of actions that are triggered if one of the condtions is fulf
illed.</dd> | |
1040 <!-- OBJECT PROPERTIES --> | |
1041 <!-- OBJECT METHODS --> | |
1042 <!-- OBJECT EVENT FIELDS --> | |
1043 <!-- FUNCTION PARAMETERS --> | |
1044 </div> | |
1045 </div><div> | |
1046 <div> | |
1047 <dt> | |
1048 <var>priority</var> | |
1049 <em> | |
1050 <!-- TYPE --> | |
1051 <div style="display:inline"> | |
1052 ( | |
1053 <span class="optional">optional</span> | |
1054 <span id="typeTemplate"> | |
1055 <span> | |
1056 <span>integer</span> | |
1057 </span> | |
1058 </span> | |
1059 ) | |
1060 </div> | |
1061 </em> | |
1062 </dt> | |
1063 <dd>Optional priority of this rule. Defaults to 100.</dd> | |
1064 <!-- OBJECT PROPERTIES --> | |
1065 <!-- OBJECT METHODS --> | |
1066 <!-- OBJECT EVENT FIELDS --> | |
1067 <!-- FUNCTION PARAMETERS --> | |
1068 </div> | |
1069 </div> | |
1070 </dl> | |
1071 </dd> | |
1072 <!-- OBJECT METHODS --> | |
1073 <!-- OBJECT EVENT FIELDS --> | |
1074 <!-- FUNCTION PARAMETERS --> | |
1075 </div> | |
1076 </div><div class="apiItem"> | |
1077 <a name="type-UrlFilter"></a> | |
1078 <h4>UrlFilter</h4> | |
1079 <div> | |
1080 <dt> | |
1081 <em> | |
1082 <!-- TYPE --> | |
1083 <div style="display:inline"> | |
1084 ( | |
1085 <span id="typeTemplate"> | |
1086 <span> | |
1087 <span>object</span> | |
1088 </span> | |
1089 </span> | |
1090 ) | |
1091 </div> | |
1092 </em> | |
1093 </dt> | |
1094 <dd>Filters URLs for various criteria</dd> | |
1095 <!-- OBJECT PROPERTIES --> | |
1096 <dd> | |
1097 <dl> | |
1098 <div> | |
1099 <div> | |
1100 <dt> | |
1101 <var>hostContains</var> | |
1102 <em> | |
1103 <!-- TYPE --> | |
1104 <div style="display:inline"> | |
1105 ( | |
1106 <span class="optional">optional</span> | |
1107 <span id="typeTemplate"> | |
1108 <span> | |
1109 <span>string</span> | |
1110 </span> | |
1111 </span> | |
1112 ) | |
1113 </div> | |
1114 </em> | |
1115 </dt> | |
1116 <dd>Matches if the host name of the URL contains a specified string.</
dd> | |
1117 <!-- OBJECT PROPERTIES --> | |
1118 <!-- OBJECT METHODS --> | |
1119 <!-- OBJECT EVENT FIELDS --> | |
1120 <!-- FUNCTION PARAMETERS --> | |
1121 </div> | |
1122 </div><div> | |
1123 <div> | |
1124 <dt> | |
1125 <var>hostEquals</var> | |
1126 <em> | |
1127 <!-- TYPE --> | |
1128 <div style="display:inline"> | |
1129 ( | |
1130 <span class="optional">optional</span> | |
1131 <span id="typeTemplate"> | |
1132 <span> | |
1133 <span>string</span> | |
1134 </span> | |
1135 </span> | |
1136 ) | |
1137 </div> | |
1138 </em> | |
1139 </dt> | |
1140 <dd>Matches if the host name of the URL is equal to a specified string
.</dd> | |
1141 <!-- OBJECT PROPERTIES --> | |
1142 <!-- OBJECT METHODS --> | |
1143 <!-- OBJECT EVENT FIELDS --> | |
1144 <!-- FUNCTION PARAMETERS --> | |
1145 </div> | |
1146 </div><div> | |
1147 <div> | |
1148 <dt> | |
1149 <var>hostPrefix</var> | |
1150 <em> | |
1151 <!-- TYPE --> | |
1152 <div style="display:inline"> | |
1153 ( | |
1154 <span class="optional">optional</span> | |
1155 <span id="typeTemplate"> | |
1156 <span> | |
1157 <span>string</span> | |
1158 </span> | |
1159 </span> | |
1160 ) | |
1161 </div> | |
1162 </em> | |
1163 </dt> | |
1164 <dd>Matches if the host name of the URL starts with a specified string
.</dd> | |
1165 <!-- OBJECT PROPERTIES --> | |
1166 <!-- OBJECT METHODS --> | |
1167 <!-- OBJECT EVENT FIELDS --> | |
1168 <!-- FUNCTION PARAMETERS --> | |
1169 </div> | |
1170 </div><div> | |
1171 <div> | |
1172 <dt> | |
1173 <var>hostSuffix</var> | |
1174 <em> | |
1175 <!-- TYPE --> | |
1176 <div style="display:inline"> | |
1177 ( | |
1178 <span class="optional">optional</span> | |
1179 <span id="typeTemplate"> | |
1180 <span> | |
1181 <span>string</span> | |
1182 </span> | |
1183 </span> | |
1184 ) | |
1185 </div> | |
1186 </em> | |
1187 </dt> | |
1188 <dd>Matches if the host name of the URL ends with a specified string.<
/dd> | |
1189 <!-- OBJECT PROPERTIES --> | |
1190 <!-- OBJECT METHODS --> | |
1191 <!-- OBJECT EVENT FIELDS --> | |
1192 <!-- FUNCTION PARAMETERS --> | |
1193 </div> | |
1194 </div><div> | |
1195 <div> | |
1196 <dt> | |
1197 <var>pathContains</var> | |
1198 <em> | |
1199 <!-- TYPE --> | |
1200 <div style="display:inline"> | |
1201 ( | |
1202 <span class="optional">optional</span> | |
1203 <span id="typeTemplate"> | |
1204 <span> | |
1205 <span>string</span> | |
1206 </span> | |
1207 </span> | |
1208 ) | |
1209 </div> | |
1210 </em> | |
1211 </dt> | |
1212 <dd>Matches if the path segment of the URL contains a specified string
.</dd> | |
1213 <!-- OBJECT PROPERTIES --> | |
1214 <!-- OBJECT METHODS --> | |
1215 <!-- OBJECT EVENT FIELDS --> | |
1216 <!-- FUNCTION PARAMETERS --> | |
1217 </div> | |
1218 </div><div> | |
1219 <div> | |
1220 <dt> | |
1221 <var>pathEquals</var> | |
1222 <em> | |
1223 <!-- TYPE --> | |
1224 <div style="display:inline"> | |
1225 ( | |
1226 <span class="optional">optional</span> | |
1227 <span id="typeTemplate"> | |
1228 <span> | |
1229 <span>string</span> | |
1230 </span> | |
1231 </span> | |
1232 ) | |
1233 </div> | |
1234 </em> | |
1235 </dt> | |
1236 <dd>Matches if the path segment of the URL is equal to a specified str
ing.</dd> | |
1237 <!-- OBJECT PROPERTIES --> | |
1238 <!-- OBJECT METHODS --> | |
1239 <!-- OBJECT EVENT FIELDS --> | |
1240 <!-- FUNCTION PARAMETERS --> | |
1241 </div> | |
1242 </div><div> | |
1243 <div> | |
1244 <dt> | |
1245 <var>pathPrefix</var> | |
1246 <em> | |
1247 <!-- TYPE --> | |
1248 <div style="display:inline"> | |
1249 ( | |
1250 <span class="optional">optional</span> | |
1251 <span id="typeTemplate"> | |
1252 <span> | |
1253 <span>string</span> | |
1254 </span> | |
1255 </span> | |
1256 ) | |
1257 </div> | |
1258 </em> | |
1259 </dt> | |
1260 <dd>Matches if the path segment of the URL starts with a specified str
ing.</dd> | |
1261 <!-- OBJECT PROPERTIES --> | |
1262 <!-- OBJECT METHODS --> | |
1263 <!-- OBJECT EVENT FIELDS --> | |
1264 <!-- FUNCTION PARAMETERS --> | |
1265 </div> | |
1266 </div><div> | |
1267 <div> | |
1268 <dt> | |
1269 <var>pathSuffix</var> | |
1270 <em> | |
1271 <!-- TYPE --> | |
1272 <div style="display:inline"> | |
1273 ( | |
1274 <span class="optional">optional</span> | |
1275 <span id="typeTemplate"> | |
1276 <span> | |
1277 <span>string</span> | |
1278 </span> | |
1279 </span> | |
1280 ) | |
1281 </div> | |
1282 </em> | |
1283 </dt> | |
1284 <dd>Matches if the path segment of the URL ends with a specified strin
g.</dd> | |
1285 <!-- OBJECT PROPERTIES --> | |
1286 <!-- OBJECT METHODS --> | |
1287 <!-- OBJECT EVENT FIELDS --> | |
1288 <!-- FUNCTION PARAMETERS --> | |
1289 </div> | |
1290 </div><div> | |
1291 <div> | |
1292 <dt> | |
1293 <var>queryContains</var> | |
1294 <em> | |
1295 <!-- TYPE --> | |
1296 <div style="display:inline"> | |
1297 ( | |
1298 <span class="optional">optional</span> | |
1299 <span id="typeTemplate"> | |
1300 <span> | |
1301 <span>string</span> | |
1302 </span> | |
1303 </span> | |
1304 ) | |
1305 </div> | |
1306 </em> | |
1307 </dt> | |
1308 <dd>Matches if the query segment of the URL contains a specified strin
g.</dd> | |
1309 <!-- OBJECT PROPERTIES --> | |
1310 <!-- OBJECT METHODS --> | |
1311 <!-- OBJECT EVENT FIELDS --> | |
1312 <!-- FUNCTION PARAMETERS --> | |
1313 </div> | |
1314 </div><div> | |
1315 <div> | |
1316 <dt> | |
1317 <var>queryEquals</var> | |
1318 <em> | |
1319 <!-- TYPE --> | |
1320 <div style="display:inline"> | |
1321 ( | |
1322 <span class="optional">optional</span> | |
1323 <span id="typeTemplate"> | |
1324 <span> | |
1325 <span>string</span> | |
1326 </span> | |
1327 </span> | |
1328 ) | |
1329 </div> | |
1330 </em> | |
1331 </dt> | |
1332 <dd>Matches if the query segment of the URL is equal to a specified st
ring.</dd> | |
1333 <!-- OBJECT PROPERTIES --> | |
1334 <!-- OBJECT METHODS --> | |
1335 <!-- OBJECT EVENT FIELDS --> | |
1336 <!-- FUNCTION PARAMETERS --> | |
1337 </div> | |
1338 </div><div> | |
1339 <div> | |
1340 <dt> | |
1341 <var>queryPrefix</var> | |
1342 <em> | |
1343 <!-- TYPE --> | |
1344 <div style="display:inline"> | |
1345 ( | |
1346 <span class="optional">optional</span> | |
1347 <span id="typeTemplate"> | |
1348 <span> | |
1349 <span>string</span> | |
1350 </span> | |
1351 </span> | |
1352 ) | |
1353 </div> | |
1354 </em> | |
1355 </dt> | |
1356 <dd>Matches if the query segment of the URL starts with a specified st
ring.</dd> | |
1357 <!-- OBJECT PROPERTIES --> | |
1358 <!-- OBJECT METHODS --> | |
1359 <!-- OBJECT EVENT FIELDS --> | |
1360 <!-- FUNCTION PARAMETERS --> | |
1361 </div> | |
1362 </div><div> | |
1363 <div> | |
1364 <dt> | |
1365 <var>querySuffix</var> | |
1366 <em> | |
1367 <!-- TYPE --> | |
1368 <div style="display:inline"> | |
1369 ( | |
1370 <span class="optional">optional</span> | |
1371 <span id="typeTemplate"> | |
1372 <span> | |
1373 <span>string</span> | |
1374 </span> | |
1375 </span> | |
1376 ) | |
1377 </div> | |
1378 </em> | |
1379 </dt> | |
1380 <dd>Matches if the query segment of the URL ends with a specified stri
ng.</dd> | |
1381 <!-- OBJECT PROPERTIES --> | |
1382 <!-- OBJECT METHODS --> | |
1383 <!-- OBJECT EVENT FIELDS --> | |
1384 <!-- FUNCTION PARAMETERS --> | |
1385 </div> | |
1386 </div><div> | |
1387 <div> | |
1388 <dt> | |
1389 <var>urlContains</var> | |
1390 <em> | |
1391 <!-- TYPE --> | |
1392 <div style="display:inline"> | |
1393 ( | |
1394 <span class="optional">optional</span> | |
1395 <span id="typeTemplate"> | |
1396 <span> | |
1397 <span>string</span> | |
1398 </span> | |
1399 </span> | |
1400 ) | |
1401 </div> | |
1402 </em> | |
1403 </dt> | |
1404 <dd>Matches if the URL contains a specified string.</dd> | |
1405 <!-- OBJECT PROPERTIES --> | |
1406 <!-- OBJECT METHODS --> | |
1407 <!-- OBJECT EVENT FIELDS --> | |
1408 <!-- FUNCTION PARAMETERS --> | |
1409 </div> | |
1410 </div><div> | |
1411 <div> | |
1412 <dt> | |
1413 <var>urlEquals</var> | |
1414 <em> | |
1415 <!-- TYPE --> | |
1416 <div style="display:inline"> | |
1417 ( | |
1418 <span class="optional">optional</span> | |
1419 <span id="typeTemplate"> | |
1420 <span> | |
1421 <span>string</span> | |
1422 </span> | |
1423 </span> | |
1424 ) | |
1425 </div> | |
1426 </em> | |
1427 </dt> | |
1428 <dd>Matches if the URL is equal to a specified string.</dd> | |
1429 <!-- OBJECT PROPERTIES --> | |
1430 <!-- OBJECT METHODS --> | |
1431 <!-- OBJECT EVENT FIELDS --> | |
1432 <!-- FUNCTION PARAMETERS --> | |
1433 </div> | |
1434 </div><div> | |
1435 <div> | |
1436 <dt> | |
1437 <var>urlPrefix</var> | |
1438 <em> | |
1439 <!-- TYPE --> | |
1440 <div style="display:inline"> | |
1441 ( | |
1442 <span class="optional">optional</span> | |
1443 <span id="typeTemplate"> | |
1444 <span> | |
1445 <span>string</span> | |
1446 </span> | |
1447 </span> | |
1448 ) | |
1449 </div> | |
1450 </em> | |
1451 </dt> | |
1452 <dd>Matches if the URL starts with a specified string.</dd> | |
1453 <!-- OBJECT PROPERTIES --> | |
1454 <!-- OBJECT METHODS --> | |
1455 <!-- OBJECT EVENT FIELDS --> | |
1456 <!-- FUNCTION PARAMETERS --> | |
1457 </div> | |
1458 </div><div> | |
1459 <div> | |
1460 <dt> | |
1461 <var>urlSuffix</var> | |
1462 <em> | |
1463 <!-- TYPE --> | |
1464 <div style="display:inline"> | |
1465 ( | |
1466 <span class="optional">optional</span> | |
1467 <span id="typeTemplate"> | |
1468 <span> | |
1469 <span>string</span> | |
1470 </span> | |
1471 </span> | |
1472 ) | |
1473 </div> | |
1474 </em> | |
1475 </dt> | |
1476 <dd>Matches if the URL ends with a specified string.</dd> | |
1477 <!-- OBJECT PROPERTIES --> | |
1478 <!-- OBJECT METHODS --> | |
1479 <!-- OBJECT EVENT FIELDS --> | |
1480 <!-- FUNCTION PARAMETERS --> | |
1481 </div> | |
1482 </div><div> | |
1483 <div> | |
1484 <dt> | |
1485 <var>schemes</var> | |
1486 <em> | |
1487 <!-- TYPE --> | |
1488 <div style="display:inline"> | |
1489 ( | |
1490 <span class="optional">optional</span> | |
1491 <span id="typeTemplate"> | |
1492 <span> | |
1493 <span> | |
1494 array of <span><span> | |
1495 <span> | |
1496 <span>string</span> | |
1497 </span> | |
1498 </span></span> | |
1499 </span> | |
1500 </span> | |
1501 </span> | |
1502 ) | |
1503 </div> | |
1504 </em> | |
1505 </dt> | |
1506 <dd>Matches if the scheme of the URL is equal to any of the schemes sp
ecified in the array.</dd> | |
1507 <!-- OBJECT PROPERTIES --> | |
1508 <!-- OBJECT METHODS --> | |
1509 <!-- OBJECT EVENT FIELDS --> | |
1510 <!-- FUNCTION PARAMETERS --> | |
1511 </div> | |
1512 </div><div> | |
1513 <div> | |
1514 <dt> | |
1515 <var>ports</var> | |
1516 <em> | |
1517 <!-- TYPE --> | |
1518 <div style="display:inline"> | |
1519 ( | |
1520 <span class="optional">optional</span> | |
1521 <span id="typeTemplate"> | |
1522 <span> | |
1523 <span> | |
1524 array of <span><span> | |
1525 <span> | |
1526 <span>integer or array of integer</span> | |
1527 </span> | |
1528 </span></span> | |
1529 </span> | |
1530 </span> | |
1531 </span> | |
1532 ) | |
1533 </div> | |
1534 </em> | |
1535 </dt> | |
1536 <dd>Matches if the port of the URL is contained in any of the specifie
d port lists. For example <code>[80, 443, [1000, 1200]]</code> matches all reque
sts on port 80, 443 and in the range 1000-1200.</dd> | |
1537 <!-- OBJECT PROPERTIES --> | |
1538 <!-- OBJECT METHODS --> | |
1539 <!-- OBJECT EVENT FIELDS --> | |
1540 <!-- FUNCTION PARAMETERS --> | |
1541 </div> | |
1542 </div> | |
1543 </dl> | |
1544 </dd> | |
1545 <!-- OBJECT METHODS --> | |
1546 <!-- OBJECT EVENT FIELDS --> | |
1547 <!-- FUNCTION PARAMETERS --> | |
1548 </div> | |
1549 </div> <!-- /apiItem --> | |
1550 </div> <!-- /apiGroup --> | |
1551 </div> <!-- /apiPage --> | |
1552 </div> <!-- /gc-pagecontent --> | |
1553 </div> <!-- /g-section --> | |
1554 </div> <!-- /codesiteContent --> | |
1555 <div id="gc-footer" --=""> | |
1556 <div class="text"> | |
1557 <p> | |
1558 Except as otherwise <a href="http://code.google.com/policies.html#restrictions
">noted</a>, | |
1559 the content of this page is licensed under the <a rel="license" href="http://c
reativecommons.org/licenses/by/3.0/">Creative Commons | |
1560 Attribution 3.0 License</a>, and code samples are licensed under the | |
1561 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic
ense</a>. | |
1562 </p> | |
1563 <p> | |
1564 ©2011 Google | |
1565 </p> | |
1566 <!-- begin analytics --> | |
1567 <script src="https://www.google-analytics.com/urchin.js" type="text/javascript">
</script> | |
1568 <script src="https://www.google-analytics.com/ga.js" type="text/javascript"></sc
ript> | |
1569 <script type="text/javascript"> | |
1570 // chrome doc tracking | |
1571 try { | |
1572 var engdocs = _gat._getTracker("YT-10763712-2"); | |
1573 engdocs._trackPageview(); | |
1574 } catch(err) {} | |
1575 // code.google.com site-wide tracking | |
1576 try { | |
1577 _uacct="UA-18071-1"; | |
1578 _uanchor=1; | |
1579 _uff=0; | |
1580 urchinTracker(); | |
1581 } | |
1582 catch(e) {/* urchinTracker not available. */} | |
1583 </script> | |
1584 <!-- end analytics --> | |
1585 </div> | |
1586 </div> <!-- /gc-footer --> | |
1587 </div> <!-- /gc-container --> | |
1588 </body></html> | |
OLD | NEW |