| 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.alarms module,
which is part of the Google Chrome extension APIs."><title>chrome.alarms - 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><a href="events.html">Events</a></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.alarms</h1> | |
| 189 </div> | |
| 190 <!-- TABLE OF CONTENTS --> | |
| 191 <div id="toc"> | |
| 192 <h2>Contents</h2> | |
| 193 <ol> | |
| 194 <li> | |
| 195 <a href="#apiReference">API reference: chrome.alarms</a> | |
| 196 <ol> | |
| 197 <li> | |
| 198 <a href="#global-methods">Methods</a> | |
| 199 <ol> | |
| 200 <li> | |
| 201 <a href="#method-clear">clear</a> | |
| 202 </li><li> | |
| 203 <a href="#method-clearAll">clearAll</a> | |
| 204 </li><li> | |
| 205 <a href="#method-create">create</a> | |
| 206 </li><li> | |
| 207 <a href="#method-get">get</a> | |
| 208 </li><li> | |
| 209 <a href="#method-getAll">getAll</a> | |
| 210 </li> | |
| 211 </ol> | |
| 212 </li> | |
| 213 <li> | |
| 214 <a href="#global-events">Events</a> | |
| 215 <ol> | |
| 216 <li> | |
| 217 <a href="#event-onAlarm">onAlarm</a> | |
| 218 </li> | |
| 219 </ol> | |
| 220 </li> | |
| 221 <li> | |
| 222 <a href="#types">Types</a> | |
| 223 <ol> | |
| 224 <li> | |
| 225 <a href="#type-alarms.Alarm">alarms.Alarm</a> | |
| 226 <ol> | |
| 227 </ol> | |
| 228 </li><li> | |
| 229 <a href="#type-alarms.AlarmCreateInfo">alarms.AlarmCreateInfo</a
> | |
| 230 <ol> | |
| 231 </ol> | |
| 232 </li> | |
| 233 </ol> | |
| 234 </li> | |
| 235 </ol> | |
| 236 </li> | |
| 237 </ol> | |
| 238 </div> | |
| 239 <!-- /TABLE OF CONTENTS --> | |
| 240 <!-- Standard content lead-in for experimental API pages --> | |
| 241 <p class="warning"> | |
| 242 <!-- Standard content lead-in for APIs that are not yet available on | |
| 243 the stable channel. --> | |
| 244 <em>Warning:</em> This API is still under development. It is only | |
| 245 available for Chrome users on the | |
| 246 <span> | |
| 247 <strong>dev</strong> | |
| 248 <a href="http://www.chromium.org/getting-involved/dev-channel">ear
ly | |
| 249 release channel</a>.</span> | |
| 250 <a href="TODO">Learn more</a>. | |
| 251 </p> | |
| 252 <!-- STATIC CONTENT PLACEHOLDER --> | |
| 253 <div id="static"></div> | |
| 254 <!-- API PAGE --> | |
| 255 <div class="apiPage"> | |
| 256 <a name="apiReference"></a> | |
| 257 <h2>API reference: chrome.alarms</h2> | |
| 258 <!-- PROPERTIES --> | |
| 259 <!-- /apiGroup --> | |
| 260 <!-- METHODS --> | |
| 261 <div id="methodsTemplate" class="apiGroup"> | |
| 262 <a name="global-methods"></a> | |
| 263 <h3>Methods</h3> | |
| 264 <!-- iterates over all functions --> | |
| 265 <div class="apiItem"> | |
| 266 <a name="method-clear"></a> <!-- method-anchor --> | |
| 267 <h4>clear</h4> | |
| 268 <div class="summary"> | |
| 269 <!-- Note: intentionally longer 80 columns --> | |
| 270 <span>chrome.alarms.clear</span>(<span class="optional"><span>
string</span> | |
| 271 <var><span>name</span></var></span>)</div> | |
| 272 <div class="description"> | |
| 273 <p>Clears the alarm with the given name.</p> | |
| 274 <!-- PARAMETERS --> | |
| 275 <h4>Parameters</h4> | |
| 276 <dl> | |
| 277 <div> | |
| 278 <div> | |
| 279 <dt> | |
| 280 <var>name</var> | |
| 281 <em> | |
| 282 <!-- TYPE --> | |
| 283 <div style="display:inline"> | |
| 284 ( | |
| 285 <span class="optional">optional</span> | |
| 286 <span id="typeTemplate"> | |
| 287 <span> | |
| 288 <span>string</span> | |
| 289 </span> | |
| 290 </span> | |
| 291 ) | |
| 292 </div> | |
| 293 </em> | |
| 294 </dt> | |
| 295 <dd>The name of the alarm to clear. Defaults to the empty string.</dd> | |
| 296 <!-- OBJECT PROPERTIES --> | |
| 297 <!-- OBJECT METHODS --> | |
| 298 <!-- OBJECT EVENT FIELDS --> | |
| 299 <!-- FUNCTION PARAMETERS --> | |
| 300 </div> | |
| 301 </div> | |
| 302 </dl> | |
| 303 <!-- RETURNS --> | |
| 304 <dl> | |
| 305 </dl> | |
| 306 <!-- CALLBACK --> | |
| 307 <!-- MIN_VERSION --> | |
| 308 </div> <!-- /description --> | |
| 309 </div><div class="apiItem"> | |
| 310 <a name="method-clearAll"></a> <!-- method-anchor --> | |
| 311 <h4>clearAll</h4> | |
| 312 <div class="summary"> | |
| 313 <!-- Note: intentionally longer 80 columns --> | |
| 314 <span>chrome.alarms.clearAll</span>()</div> | |
| 315 <div class="description"> | |
| 316 <p>Clears all alarms.</p> | |
| 317 <!-- PARAMETERS --> | |
| 318 <dl> | |
| 319 </dl> | |
| 320 <!-- RETURNS --> | |
| 321 <dl> | |
| 322 </dl> | |
| 323 <!-- CALLBACK --> | |
| 324 <!-- MIN_VERSION --> | |
| 325 </div> <!-- /description --> | |
| 326 </div><div class="apiItem"> | |
| 327 <a name="method-create"></a> <!-- method-anchor --> | |
| 328 <h4>create</h4> | |
| 329 <div class="summary"> | |
| 330 <!-- Note: intentionally longer 80 columns --> | |
| 331 <span>chrome.alarms.create</span>(<span class="optional"><span
>string</span> | |
| 332 <var><span>name</span></var></span><span class="null"><spa
n>, </span><span>alarms.AlarmCreateInfo</span> | |
| 333 <var><span>alarmInfo</span></var></span>)</div> | |
| 334 <div class="description"> | |
| 335 <p>Creates an alarm. Near the time(s) specified by <var>alarmIn
fo</var>, the <code>onAlarm</code> event is fired. If there is another alarm wit
h the same name (or no name if none is specified), it will be cancelled and repl
aced by this alarm. Note that granularity is not guaranteed: times are more of a
hint to the browser. For performance reasons, alarms may be delayed an arbitrar
y amount of time before firing.</p> | |
| 336 <!-- PARAMETERS --> | |
| 337 <h4>Parameters</h4> | |
| 338 <dl> | |
| 339 <div> | |
| 340 <div> | |
| 341 <dt> | |
| 342 <var>name</var> | |
| 343 <em> | |
| 344 <!-- TYPE --> | |
| 345 <div style="display:inline"> | |
| 346 ( | |
| 347 <span class="optional">optional</span> | |
| 348 <span id="typeTemplate"> | |
| 349 <span> | |
| 350 <span>string</span> | |
| 351 </span> | |
| 352 </span> | |
| 353 ) | |
| 354 </div> | |
| 355 </em> | |
| 356 </dt> | |
| 357 <dd>Optional name to identify this alarm. Defaults to the empty string
.</dd> | |
| 358 <!-- OBJECT PROPERTIES --> | |
| 359 <!-- OBJECT METHODS --> | |
| 360 <!-- OBJECT EVENT FIELDS --> | |
| 361 <!-- FUNCTION PARAMETERS --> | |
| 362 </div> | |
| 363 </div><div> | |
| 364 <div> | |
| 365 <dt> | |
| 366 <var>alarmInfo</var> | |
| 367 <em> | |
| 368 <!-- TYPE --> | |
| 369 <div style="display:inline"> | |
| 370 ( | |
| 371 <span id="typeTemplate"> | |
| 372 <span> | |
| 373 <a href="alarms.html#type-alarms.AlarmCreateInfo">alarms
.AlarmCreateInfo</a> | |
| 374 </span> | |
| 375 </span> | |
| 376 ) | |
| 377 </div> | |
| 378 </em> | |
| 379 </dt> | |
| 380 <dd>Describes when the alarm should fire. The initial time must be sp
ecified by either <var>when</var> or <var>delayInMinutes</var> (but not both).
If <var>periodInMinutes</var> is set, the alarm will repeat every <var>periodInM
inutes</var> minutes after the initial event. If neither <var>when</var> or <va
r>delayInMinutes</var> is set for a repeating alarm, <var>periodInMinutes</var>
is used as the default for <var>delayInMinutes</var>.</dd> | |
| 381 <!-- OBJECT PROPERTIES --> | |
| 382 <!-- OBJECT METHODS --> | |
| 383 <!-- OBJECT EVENT FIELDS --> | |
| 384 <!-- FUNCTION PARAMETERS --> | |
| 385 </div> | |
| 386 </div> | |
| 387 </dl> | |
| 388 <!-- RETURNS --> | |
| 389 <dl> | |
| 390 </dl> | |
| 391 <!-- CALLBACK --> | |
| 392 <!-- MIN_VERSION --> | |
| 393 </div> <!-- /description --> | |
| 394 </div><div class="apiItem"> | |
| 395 <a name="method-get"></a> <!-- method-anchor --> | |
| 396 <h4>get</h4> | |
| 397 <div class="summary"> | |
| 398 <!-- Note: intentionally longer 80 columns --> | |
| 399 <span>chrome.alarms.get</span>(<span class="optional"><span>st
ring</span> | |
| 400 <var><span>name</span></var></span><span class="null"><spa
n>, </span><span>function</span> | |
| 401 <var><span>AlarmCallback</span></var></span>)</div> | |
| 402 <div class="description"> | |
| 403 <p>Retrieves details about the specified alarm.</p> | |
| 404 <!-- PARAMETERS --> | |
| 405 <h4>Parameters</h4> | |
| 406 <dl> | |
| 407 <div> | |
| 408 <div> | |
| 409 <dt> | |
| 410 <var>name</var> | |
| 411 <em> | |
| 412 <!-- TYPE --> | |
| 413 <div style="display:inline"> | |
| 414 ( | |
| 415 <span class="optional">optional</span> | |
| 416 <span id="typeTemplate"> | |
| 417 <span> | |
| 418 <span>string</span> | |
| 419 </span> | |
| 420 </span> | |
| 421 ) | |
| 422 </div> | |
| 423 </em> | |
| 424 </dt> | |
| 425 <dd>The name of the alarm to get. Defaults to the empty string.</dd> | |
| 426 <!-- OBJECT PROPERTIES --> | |
| 427 <!-- OBJECT METHODS --> | |
| 428 <!-- OBJECT EVENT FIELDS --> | |
| 429 <!-- FUNCTION PARAMETERS --> | |
| 430 </div> | |
| 431 </div><div> | |
| 432 <div> | |
| 433 <dt> | |
| 434 <var>AlarmCallback</var> | |
| 435 <em> | |
| 436 <!-- TYPE --> | |
| 437 <div style="display:inline"> | |
| 438 ( | |
| 439 <span id="typeTemplate"> | |
| 440 <span> | |
| 441 <span>function</span> | |
| 442 </span> | |
| 443 </span> | |
| 444 ) | |
| 445 </div> | |
| 446 </em> | |
| 447 </dt> | |
| 448 <dd class="todo"> | |
| 449 Undocumented. | |
| 450 </dd> | |
| 451 <!-- OBJECT PROPERTIES --> | |
| 452 <!-- OBJECT METHODS --> | |
| 453 <!-- OBJECT EVENT FIELDS --> | |
| 454 <!-- FUNCTION PARAMETERS --> | |
| 455 <dd> | |
| 456 <div> | |
| 457 <h5>Parameters</h5> | |
| 458 <dl> | |
| 459 <div> | |
| 460 <div> | |
| 461 <dt> | |
| 462 <var>alarm</var> | |
| 463 <em> | |
| 464 <!-- TYPE --> | |
| 465 <div style="display:inline"> | |
| 466 ( | |
| 467 <span id="typeTemplate"> | |
| 468 <span> | |
| 469 <a href="alarms.html#type-alarms.Alarm">alarms.Alarm</a> | |
| 470 </span> | |
| 471 </span> | |
| 472 ) | |
| 473 </div> | |
| 474 </em> | |
| 475 </dt> | |
| 476 <dd class="todo"> | |
| 477 Undocumented. | |
| 478 </dd> | |
| 479 <!-- OBJECT PROPERTIES --> | |
| 480 <!-- OBJECT METHODS --> | |
| 481 <!-- OBJECT EVENT FIELDS --> | |
| 482 <!-- FUNCTION PARAMETERS --> | |
| 483 </div> | |
| 484 </div> | |
| 485 </dl> | |
| 486 </div> | |
| 487 </dd> | |
| 488 </div> | |
| 489 </div> | |
| 490 </dl> | |
| 491 <!-- RETURNS --> | |
| 492 <dl> | |
| 493 </dl> | |
| 494 <!-- CALLBACK --> | |
| 495 <div> | |
| 496 <div> | |
| 497 <h4>Callback function</h4> | |
| 498 <p> | |
| 499 The <em>callback</em> parameter should specify a function | |
| 500 that looks like this: | |
| 501 </p> | |
| 502 <!-- Note: intentionally longer 80 columns --> | |
| 503 <pre>function(<span>alarms.Alarm alarm</span>) <span class="su
bdued">{...}</span>;</pre> | |
| 504 <dl> | |
| 505 <div> | |
| 506 <div> | |
| 507 <dt> | |
| 508 <var>alarm</var> | |
| 509 <em> | |
| 510 <!-- TYPE --> | |
| 511 <div style="display:inline"> | |
| 512 ( | |
| 513 <span id="typeTemplate"> | |
| 514 <span> | |
| 515 <a href="alarms.html#type-alarms.Alarm">alarms.Alarm</a> | |
| 516 </span> | |
| 517 </span> | |
| 518 ) | |
| 519 </div> | |
| 520 </em> | |
| 521 </dt> | |
| 522 <dd class="todo"> | |
| 523 Undocumented. | |
| 524 </dd> | |
| 525 <!-- OBJECT PROPERTIES --> | |
| 526 <!-- OBJECT METHODS --> | |
| 527 <!-- OBJECT EVENT FIELDS --> | |
| 528 <!-- FUNCTION PARAMETERS --> | |
| 529 </div> | |
| 530 </div> | |
| 531 </dl> | |
| 532 </div> | |
| 533 </div> | |
| 534 <!-- MIN_VERSION --> | |
| 535 </div> <!-- /description --> | |
| 536 </div><div class="apiItem"> | |
| 537 <a name="method-getAll"></a> <!-- method-anchor --> | |
| 538 <h4>getAll</h4> | |
| 539 <div class="summary"> | |
| 540 <!-- Note: intentionally longer 80 columns --> | |
| 541 <span>chrome.alarms.getAll</span>(<span class="null"><span>fun
ction</span> | |
| 542 <var><span>AlarmListCallback</span></var></span>)</div> | |
| 543 <div class="description"> | |
| 544 <p>Gets an array of all the alarms.</p> | |
| 545 <!-- PARAMETERS --> | |
| 546 <h4>Parameters</h4> | |
| 547 <dl> | |
| 548 <div> | |
| 549 <div> | |
| 550 <dt> | |
| 551 <var>AlarmListCallback</var> | |
| 552 <em> | |
| 553 <!-- TYPE --> | |
| 554 <div style="display:inline"> | |
| 555 ( | |
| 556 <span id="typeTemplate"> | |
| 557 <span> | |
| 558 <span>function</span> | |
| 559 </span> | |
| 560 </span> | |
| 561 ) | |
| 562 </div> | |
| 563 </em> | |
| 564 </dt> | |
| 565 <dd class="todo"> | |
| 566 Undocumented. | |
| 567 </dd> | |
| 568 <!-- OBJECT PROPERTIES --> | |
| 569 <!-- OBJECT METHODS --> | |
| 570 <!-- OBJECT EVENT FIELDS --> | |
| 571 <!-- FUNCTION PARAMETERS --> | |
| 572 <dd> | |
| 573 <div> | |
| 574 <h5>Parameters</h5> | |
| 575 <dl> | |
| 576 <div> | |
| 577 <div> | |
| 578 <dt> | |
| 579 <var>alarms</var> | |
| 580 <em> | |
| 581 <!-- TYPE --> | |
| 582 <div style="display:inline"> | |
| 583 ( | |
| 584 <span id="typeTemplate"> | |
| 585 <span> | |
| 586 <span> | |
| 587 array of <span><span> | |
| 588 <span> | |
| 589 <a href="alarms.html#type-alarms.Alarm">alarms.Alarm</a> | |
| 590 </span> | |
| 591 </span></span> | |
| 592 </span> | |
| 593 </span> | |
| 594 </span> | |
| 595 ) | |
| 596 </div> | |
| 597 </em> | |
| 598 </dt> | |
| 599 <dd class="todo"> | |
| 600 Undocumented. | |
| 601 </dd> | |
| 602 <!-- OBJECT PROPERTIES --> | |
| 603 <!-- OBJECT METHODS --> | |
| 604 <!-- OBJECT EVENT FIELDS --> | |
| 605 <!-- FUNCTION PARAMETERS --> | |
| 606 </div> | |
| 607 </div> | |
| 608 </dl> | |
| 609 </div> | |
| 610 </dd> | |
| 611 </div> | |
| 612 </div> | |
| 613 </dl> | |
| 614 <!-- RETURNS --> | |
| 615 <dl> | |
| 616 </dl> | |
| 617 <!-- CALLBACK --> | |
| 618 <div> | |
| 619 <div> | |
| 620 <h4>Callback function</h4> | |
| 621 <p> | |
| 622 The <em>callback</em> parameter should specify a function | |
| 623 that looks like this: | |
| 624 </p> | |
| 625 <!-- Note: intentionally longer 80 columns --> | |
| 626 <pre>function(<span>array of alarms.Alarm alarms</span>) <span
class="subdued">{...}</span>;</pre> | |
| 627 <dl> | |
| 628 <div> | |
| 629 <div> | |
| 630 <dt> | |
| 631 <var>alarms</var> | |
| 632 <em> | |
| 633 <!-- TYPE --> | |
| 634 <div style="display:inline"> | |
| 635 ( | |
| 636 <span id="typeTemplate"> | |
| 637 <span> | |
| 638 <span> | |
| 639 array of <span><span> | |
| 640 <span> | |
| 641 <a href="alarms.html#type-alarms.Alarm">alarms.Alarm</a> | |
| 642 </span> | |
| 643 </span></span> | |
| 644 </span> | |
| 645 </span> | |
| 646 </span> | |
| 647 ) | |
| 648 </div> | |
| 649 </em> | |
| 650 </dt> | |
| 651 <dd class="todo"> | |
| 652 Undocumented. | |
| 653 </dd> | |
| 654 <!-- OBJECT PROPERTIES --> | |
| 655 <!-- OBJECT METHODS --> | |
| 656 <!-- OBJECT EVENT FIELDS --> | |
| 657 <!-- FUNCTION PARAMETERS --> | |
| 658 </div> | |
| 659 </div> | |
| 660 </dl> | |
| 661 </div> | |
| 662 </div> | |
| 663 <!-- MIN_VERSION --> | |
| 664 </div> <!-- /description --> | |
| 665 </div> <!-- /apiItem --> | |
| 666 </div> <!-- /apiGroup --> | |
| 667 <!-- EVENTS --> | |
| 668 <div id="eventsTemplate" class="apiGroup"> | |
| 669 <a name="global-events"></a> | |
| 670 <h3>Events</h3> | |
| 671 <!-- iterates over all events --> | |
| 672 <div class="apiItem"> | |
| 673 <a name="event-onAlarm"></a> | |
| 674 <h4>onAlarm</h4> | |
| 675 <div class="summary"> | |
| 676 <!-- Note: intentionally longer 80 columns --> | |
| 677 <span class="subdued">chrome.alarms.</span><span>onAlarm</span><
span class="subdued">.addListener</span>(function(<span>alarms.Alarm alarm</span
>) <span class="subdued">{...}</span><span></span>); | |
| 678 </div> | |
| 679 <div class="description"> | |
| 680 <p>Fired when an alarm has elapsed. Useful for transient backgro
und pages.</p> | |
| 681 <!-- LISTENER PARAMETERS --> | |
| 682 <div> | |
| 683 <h4>Listener parameters</h4> | |
| 684 <dl> | |
| 685 <div> | |
| 686 <div> | |
| 687 <dt> | |
| 688 <var>alarm</var> | |
| 689 <em> | |
| 690 <!-- TYPE --> | |
| 691 <div style="display:inline"> | |
| 692 ( | |
| 693 <span id="typeTemplate"> | |
| 694 <span> | |
| 695 <a href="alarms.html#type-alarms.Alarm">alarms.Alarm</a> | |
| 696 </span> | |
| 697 </span> | |
| 698 ) | |
| 699 </div> | |
| 700 </em> | |
| 701 </dt> | |
| 702 <dd>The alarm that has elapsed.</dd> | |
| 703 <!-- OBJECT PROPERTIES --> | |
| 704 <!-- OBJECT METHODS --> | |
| 705 <!-- OBJECT EVENT FIELDS --> | |
| 706 <!-- FUNCTION PARAMETERS --> | |
| 707 </div> | |
| 708 </div> | |
| 709 </dl> | |
| 710 </div> | |
| 711 <!-- EXTRA PARAMETERS --> | |
| 712 <!-- LISTENER RETURN VALUE --> | |
| 713 <dl> | |
| 714 </dl> | |
| 715 </div> <!-- /description --> | |
| 716 <!-- /description --> | |
| 717 </div> <!-- /apiItem --> | |
| 718 </div> <!-- /apiGroup --> | |
| 719 <!-- TYPES --> | |
| 720 <div class="apiGroup"> | |
| 721 <a name="types"></a> | |
| 722 <h3 id="types">Types</h3> | |
| 723 <!-- iterates over all types --> | |
| 724 <div class="apiItem"> | |
| 725 <a name="type-alarms.Alarm"></a> | |
| 726 <h4>alarms.Alarm</h4> | |
| 727 <div> | |
| 728 <dt> | |
| 729 <em> | |
| 730 <!-- TYPE --> | |
| 731 <div style="display:inline"> | |
| 732 ( | |
| 733 <span id="typeTemplate"> | |
| 734 <span> | |
| 735 <span>object</span> | |
| 736 </span> | |
| 737 </span> | |
| 738 ) | |
| 739 </div> | |
| 740 </em> | |
| 741 </dt> | |
| 742 <dd class="todo"> | |
| 743 Undocumented. | |
| 744 </dd> | |
| 745 <!-- OBJECT PROPERTIES --> | |
| 746 <dd> | |
| 747 <dl> | |
| 748 <div> | |
| 749 <div> | |
| 750 <dt> | |
| 751 <var>name</var> | |
| 752 <em> | |
| 753 <!-- TYPE --> | |
| 754 <div style="display:inline"> | |
| 755 ( | |
| 756 <span id="typeTemplate"> | |
| 757 <span> | |
| 758 <span>string</span> | |
| 759 </span> | |
| 760 </span> | |
| 761 ) | |
| 762 </div> | |
| 763 </em> | |
| 764 </dt> | |
| 765 <dd>Name of this alarm.</dd> | |
| 766 <!-- OBJECT PROPERTIES --> | |
| 767 <!-- OBJECT METHODS --> | |
| 768 <!-- OBJECT EVENT FIELDS --> | |
| 769 <!-- FUNCTION PARAMETERS --> | |
| 770 </div> | |
| 771 </div><div> | |
| 772 <div> | |
| 773 <dt> | |
| 774 <var>periodInMinutes</var> | |
| 775 <em> | |
| 776 <!-- TYPE --> | |
| 777 <div style="display:inline"> | |
| 778 ( | |
| 779 <span class="optional">optional</span> | |
| 780 <span id="typeTemplate"> | |
| 781 <span> | |
| 782 <span>number</span> | |
| 783 </span> | |
| 784 </span> | |
| 785 ) | |
| 786 </div> | |
| 787 </em> | |
| 788 </dt> | |
| 789 <dd>If not null, the alarm is a repeating alarm and will fire again in
<var>periodInMinutes</var> minutes.</dd> | |
| 790 <!-- OBJECT PROPERTIES --> | |
| 791 <!-- OBJECT METHODS --> | |
| 792 <!-- OBJECT EVENT FIELDS --> | |
| 793 <!-- FUNCTION PARAMETERS --> | |
| 794 </div> | |
| 795 </div><div> | |
| 796 <div> | |
| 797 <dt> | |
| 798 <var>scheduledTime</var> | |
| 799 <em> | |
| 800 <!-- TYPE --> | |
| 801 <div style="display:inline"> | |
| 802 ( | |
| 803 <span id="typeTemplate"> | |
| 804 <span> | |
| 805 <span>number</span> | |
| 806 </span> | |
| 807 </span> | |
| 808 ) | |
| 809 </div> | |
| 810 </em> | |
| 811 </dt> | |
| 812 <dd>Time at which this alarm was scheduled to fire, in milliseconds pa
st the epoch (e.g. <code>Date.now() + n</code>). For performance reasons, the a
larm may have been delayed an arbitrary amount beyond this.</dd> | |
| 813 <!-- OBJECT PROPERTIES --> | |
| 814 <!-- OBJECT METHODS --> | |
| 815 <!-- OBJECT EVENT FIELDS --> | |
| 816 <!-- FUNCTION PARAMETERS --> | |
| 817 </div> | |
| 818 </div> | |
| 819 </dl> | |
| 820 </dd> | |
| 821 <!-- OBJECT METHODS --> | |
| 822 <!-- OBJECT EVENT FIELDS --> | |
| 823 <!-- FUNCTION PARAMETERS --> | |
| 824 </div> | |
| 825 </div><div class="apiItem"> | |
| 826 <a name="type-alarms.AlarmCreateInfo"></a> | |
| 827 <h4>alarms.AlarmCreateInfo</h4> | |
| 828 <div> | |
| 829 <dt> | |
| 830 <em> | |
| 831 <!-- TYPE --> | |
| 832 <div style="display:inline"> | |
| 833 ( | |
| 834 <span id="typeTemplate"> | |
| 835 <span> | |
| 836 <span>object</span> | |
| 837 </span> | |
| 838 </span> | |
| 839 ) | |
| 840 </div> | |
| 841 </em> | |
| 842 </dt> | |
| 843 <dd class="todo"> | |
| 844 Undocumented. | |
| 845 </dd> | |
| 846 <!-- OBJECT PROPERTIES --> | |
| 847 <dd> | |
| 848 <dl> | |
| 849 <div> | |
| 850 <div> | |
| 851 <dt> | |
| 852 <var>delayInMinutes</var> | |
| 853 <em> | |
| 854 <!-- TYPE --> | |
| 855 <div style="display:inline"> | |
| 856 ( | |
| 857 <span class="optional">optional</span> | |
| 858 <span id="typeTemplate"> | |
| 859 <span> | |
| 860 <span>number</span> | |
| 861 </span> | |
| 862 </span> | |
| 863 ) | |
| 864 </div> | |
| 865 </em> | |
| 866 </dt> | |
| 867 <dd>Length of time in minutes after which the <code>onAlarm</code> eve
nt should fire. <!-- TODO: need minimum=0 --></dd> | |
| 868 <!-- OBJECT PROPERTIES --> | |
| 869 <!-- OBJECT METHODS --> | |
| 870 <!-- OBJECT EVENT FIELDS --> | |
| 871 <!-- FUNCTION PARAMETERS --> | |
| 872 </div> | |
| 873 </div><div> | |
| 874 <div> | |
| 875 <dt> | |
| 876 <var>periodInMinutes</var> | |
| 877 <em> | |
| 878 <!-- TYPE --> | |
| 879 <div style="display:inline"> | |
| 880 ( | |
| 881 <span class="optional">optional</span> | |
| 882 <span id="typeTemplate"> | |
| 883 <span> | |
| 884 <span>number</span> | |
| 885 </span> | |
| 886 </span> | |
| 887 ) | |
| 888 </div> | |
| 889 </em> | |
| 890 </dt> | |
| 891 <dd>If set, the onAlarm event should fire every <var>periodInMinutes</
var> minutes after the initial event specified by <var>when</var> or <var>delayI
nMinutes</var>. If not set, the alarm will only fire once. <!-- TODO: need mini
mum=0 --></dd> | |
| 892 <!-- OBJECT PROPERTIES --> | |
| 893 <!-- OBJECT METHODS --> | |
| 894 <!-- OBJECT EVENT FIELDS --> | |
| 895 <!-- FUNCTION PARAMETERS --> | |
| 896 </div> | |
| 897 </div><div> | |
| 898 <div> | |
| 899 <dt> | |
| 900 <var>when</var> | |
| 901 <em> | |
| 902 <!-- TYPE --> | |
| 903 <div style="display:inline"> | |
| 904 ( | |
| 905 <span class="optional">optional</span> | |
| 906 <span id="typeTemplate"> | |
| 907 <span> | |
| 908 <span>number</span> | |
| 909 </span> | |
| 910 </span> | |
| 911 ) | |
| 912 </div> | |
| 913 </em> | |
| 914 </dt> | |
| 915 <dd>Time at which the alarm should fire, in milliseconds past the epoc
h (e.g. <code>Date.now() + n</code>).</dd> | |
| 916 <!-- OBJECT PROPERTIES --> | |
| 917 <!-- OBJECT METHODS --> | |
| 918 <!-- OBJECT EVENT FIELDS --> | |
| 919 <!-- FUNCTION PARAMETERS --> | |
| 920 </div> | |
| 921 </div> | |
| 922 </dl> | |
| 923 </dd> | |
| 924 <!-- OBJECT METHODS --> | |
| 925 <!-- OBJECT EVENT FIELDS --> | |
| 926 <!-- FUNCTION PARAMETERS --> | |
| 927 </div> | |
| 928 </div> <!-- /apiItem --> | |
| 929 </div> <!-- /apiGroup --> | |
| 930 </div> <!-- /apiPage --> | |
| 931 </div> <!-- /gc-pagecontent --> | |
| 932 </div> <!-- /g-section --> | |
| 933 </div> <!-- /codesiteContent --> | |
| 934 <div id="gc-footer" --=""> | |
| 935 <div class="text"> | |
| 936 <p> | |
| 937 Except as otherwise <a href="http://code.google.com/policies.html#restrictions
">noted</a>, | |
| 938 the content of this page is licensed under the <a rel="license" href="http://c
reativecommons.org/licenses/by/3.0/">Creative Commons | |
| 939 Attribution 3.0 License</a>, and code samples are licensed under the | |
| 940 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic
ense</a>. | |
| 941 </p> | |
| 942 <p> | |
| 943 ©2011 Google | |
| 944 </p> | |
| 945 <!-- begin analytics --> | |
| 946 <script src="https://www.google-analytics.com/urchin.js" type="text/javascript">
</script> | |
| 947 <script src="https://www.google-analytics.com/ga.js" type="text/javascript"></sc
ript> | |
| 948 <script type="text/javascript"> | |
| 949 // chrome doc tracking | |
| 950 try { | |
| 951 var engdocs = _gat._getTracker("YT-10763712-2"); | |
| 952 engdocs._trackPageview(); | |
| 953 } catch(err) {} | |
| 954 // code.google.com site-wide tracking | |
| 955 try { | |
| 956 _uacct="UA-18071-1"; | |
| 957 _uanchor=1; | |
| 958 _uff=0; | |
| 959 urchinTracker(); | |
| 960 } | |
| 961 catch(e) {/* urchinTracker not available. */} | |
| 962 </script> | |
| 963 <!-- end analytics --> | |
| 964 </div> | |
| 965 </div> <!-- /gc-footer --> | |
| 966 </div> <!-- /gc-container --> | |
| 967 </body></html> | |
| OLD | NEW |