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="js/api_page_generator.js"></script> |
| 17 <script type="text/javascript" src="js/bootstrap.js"></script> |
| 18 <title>Override Pages</title></head><body> <div id="container"> |
| 19 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> |
| 20 <!-- In particular, sub-templates that recurse, must be used by allowing |
| 21 jstemplate to make a copy of the template in this section which |
| 22 are not operated on by way of the jsskip="true" --> |
| 23 <div style="display:none"> |
| 24 |
| 25 <!-- VALUE --> |
| 26 <div id="valueTemplate"> |
| 27 <dt> |
| 28 <var>paramName</var> |
| 29 <em> |
| 30 |
| 31 <!-- TYPE --> |
| 32 <div style="display:inline"> |
| 33 ( |
| 34 <span class="optional">optional</span> |
| 35 <span id="typeTemplate"> |
| 36 <span> |
| 37 <a> Type</a> |
| 38 </span> |
| 39 <span> |
| 40 <span> |
| 41 array of <span><span></span></span> |
| 42 </span> |
| 43 <span>paramType</span> |
| 44 </span> |
| 45 </span> |
| 46 ) |
| 47 </div> |
| 48 |
| 49 </em> |
| 50 </dt> |
| 51 <dd class="todo"> |
| 52 Undocumented. |
| 53 </dd> |
| 54 <dd> |
| 55 Description of this parameter from the json schema. |
| 56 </dd> |
| 57 |
| 58 <!-- OBJECT PROPERTIES --> |
| 59 <dd> |
| 60 <dl> |
| 61 <div> |
| 62 <div> |
| 63 </div> |
| 64 </div> |
| 65 </dl> |
| 66 </dd> |
| 67 </div> <!-- /VALUE --> |
| 68 |
| 69 </div> <!-- /SUBTEMPLATES --> |
| 70 |
| 71 <a name="top"> </a> |
| 72 <!-- API HEADER --> |
| 73 <div id="pageHeader"> |
| 74 <div id="searchbox"> |
| 75 <form action="http://www.google.com/cse" id="cse-search-box"> |
| 76 <div> |
| 77 <input type="hidden" name="cx" value="002967670403910741006:61_cvzfq
tno"> |
| 78 <input type="hidden" name="ie" value="UTF-8"> |
| 79 <input type="text" name="q" size="31"> |
| 80 <input type="submit" name="sa" value="Search"> |
| 81 </div> |
| 82 </form> |
| 83 |
| 84 <script type="text/javascript" src="http://www.google.com/jsapi"></scrip
t> |
| 85 <script type="text/javascript">google.load("elements", "1", {packages: "
transliteration"});</script> |
| 86 <script type="text/javascript" src="http://www.google.com/coop/cse/t13n?
form=cse-search-box&t13n_langs=en"></script> |
| 87 <script type="text/javascript" src="http://www.google.com/coop/cse/brand
?form=cse-search-box&lang=en"></script> |
| 88 </div> |
| 89 <div id="pageTitle"> |
| 90 <h1>Override Pages</h1> |
| 91 </div> |
| 92 </div> <!-- /pageHeader --> |
| 93 |
| 94 <div id="pageContent"> |
| 95 <!-- SIDENAV --> |
| 96 <div id="leftNav"> |
| 97 <ul> |
| 98 <li> <a href="index.html">Home</a></li> |
| 99 <li> <a href="getstarted.html">Getting Started</a></li> |
| 100 <li> <a href="overview.html">Overview</a></li> |
| 101 <li> <a href="devguide.html"><div>Developer's Guide</div></a> |
| 102 <ul> |
| 103 <li> Browser UI |
| 104 <ul> |
| 105 <li><a href="browserAction.html">Browser Actions</a></li> |
| 106 <li><a href="options.html">Options Pages</a></li> |
| 107 <li class="leftNavSelected">Override Pages</li> |
| 108 <li><a href="pageAction.html">Page Actions</a></li> |
| 109 <li><a href="themes.html">Themes</a></li> |
| 110 </ul> |
| 111 </li> |
| 112 <li> Browser Interaction |
| 113 <ul> |
| 114 <li><a href="bookmarks.html">Bookmarks</a></li> |
| 115 <li><a href="events.html">Events</a></li> |
| 116 <li><a href="tabs.html">Tabs</a></li> |
| 117 <li><a href="windows.html">Windows</a></li> |
| 118 </ul> |
| 119 </li> |
| 120 <li> Implementation |
| 121 <ul> |
| 122 <li><a href="background_pages.html">Background Pages</a></li> |
| 123 <li><a href="content_scripts.html">Content Scripts</a></li> |
| 124 <li><a href="xhr.html">Cross-Origin XHR</a></li> |
| 125 <li><a href="npapi.html">NPAPI Plugins</a></li> |
| 126 </ul> |
| 127 </li> |
| 128 <li> Finishing |
| 129 <ul> |
| 130 <li><a href="autoupdate.html">Autoupdating</a></li> |
| 131 <li><a href="packaging.html">Packaging</a></li> |
| 132 </ul> |
| 133 </li> |
| 134 </ul> |
| 135 </li> |
| 136 <li><a href="tutorials.html"><div>Tutorials</div></a> |
| 137 <ul> |
| 138 <li><a href="tut_debugging.html">Debugging</a></li> |
| 139 </ul> |
| 140 </li> |
| 141 <li>Reference |
| 142 <ul> |
| 143 <li> Formats |
| 144 <ul> |
| 145 <li><a href="manifest.html">Manifest Files</a></li> |
| 146 <li><a href="match_patterns.html">Match Patterns</a></li> |
| 147 <!-- <li>Packages (.crx)</li> --> |
| 148 </ul> |
| 149 </li> |
| 150 <li> <a href="api_index.html">chrome.* APIs</a> </li> |
| 151 <li> <a href="api_other.html">Other APIs</a> </li> |
| 152 </ul> |
| 153 </li> |
| 154 <li><a href="http://dev.chromium.org/developers/design-documents/extens
ions/samples">Samples</a></li> |
| 155 </ul> |
| 156 </div> |
| 157 |
| 158 <div id="mainColumn"> |
| 159 <!-- TABLE OF CONTENTS --> |
| 160 <div id="toc" style="display: none; "> |
| 161 <p>Contents</p> |
| 162 <ol> |
| 163 <li> |
| 164 <a>h2Name</a> |
| 165 <ol> |
| 166 <li> |
| 167 <a>h3Name</a> |
| 168 </li> |
| 169 </ol> |
| 170 </li> |
| 171 <div> |
| 172 <li> |
| 173 <a href="#apiReference">API reference</a> |
| 174 <ol> |
| 175 <li> |
| 176 <a href="#properties">Properties</a> |
| 177 <ol> |
| 178 <li> |
| 179 <a href="#property-anchor">propertyName</a> |
| 180 </li> |
| 181 </ol> |
| 182 </li> |
| 183 <li> |
| 184 <a href="#methods">Methods</a> |
| 185 <ol> |
| 186 <li> |
| 187 <a href="#method-anchor">methodName</a> |
| 188 </li> |
| 189 </ol> |
| 190 </li> |
| 191 <li> |
| 192 <a href="#events">Events</a> |
| 193 <ol> |
| 194 <li> |
| 195 <a href="#event-anchor">eventName</a> |
| 196 </li> |
| 197 </ol> |
| 198 </li> |
| 199 <li> |
| 200 <a href="#types">Types</a> |
| 201 <ol> |
| 202 <li> |
| 203 <a href="#id-anchor">id</a> |
| 204 </li> |
| 205 </ol> |
| 206 </li> |
| 207 </ol> |
| 208 </li> |
| 209 </div> |
| 210 </ol> |
| 211 </div> |
| 212 <!-- /TABLE OF CONTENTS --> |
| 213 |
| 214 <!-- STATIC CONTENT PLACEHOLDER --> |
| 215 <div id="static"><style> |
| 216 #pics { |
| 217 margin:2em 1em 1.5em; |
| 218 } |
| 219 |
| 220 #pics td { |
| 221 text-align:center; |
| 222 width:50%!important; |
| 223 border:none; |
| 224 padding:0 1em; |
| 225 font-size:90%; |
| 226 } |
| 227 |
| 228 #pics img { |
| 229 width:188; |
| 230 height:246; |
| 231 border:none; |
| 232 } |
| 233 </style> |
| 234 |
| 235 <div id="pageData-title" class="pageData">Override Pages</div> |
| 236 |
| 237 <p> |
| 238 Override pages are a way to replace a page |
| 239 that Google Chrome provides |
| 240 with an HTML file that your extension provides. |
| 241 An override page usually has CSS and JavaScript code, |
| 242 in addition to HTML. |
| 243 </p> |
| 244 |
| 245 <p> |
| 246 Currently, the only page you can replace is |
| 247 the <em>New Tab page</em> — |
| 248 the page that appears |
| 249 when the user creates a new tab or window. |
| 250 </p> |
| 251 |
| 252 <table id="pics"> |
| 253 <tbody><tr> |
| 254 <td> <b>The default New Tab page</b> </td> |
| 255 <td> <b>An alternative New Tab page</b> </td> |
| 256 </tr> |
| 257 <tr> |
| 258 <td> |
| 259 <img src="images/ntp-default.png" alt="default New Tab page"> |
| 260 </td> |
| 261 <td> |
| 262 <img src="images/ntp-blank.png" alt="a blank New Tab page"> |
| 263 </td> |
| 264 </tr> |
| 265 </tbody></table> |
| 266 |
| 267 |
| 268 <p class="comment"> |
| 269 [PENDING: update these screenshots.] |
| 270 </p> |
| 271 |
| 272 <h2 id="manifest">Manifest</h2> |
| 273 |
| 274 <p> |
| 275 Register your New Tab page in the |
| 276 <a href="manifest.html">extension manifest</a> |
| 277 like this: |
| 278 </p> |
| 279 |
| 280 <pre>"chrome_url_overrides": { |
| 281 "newtab": "newtab.html" |
| 282 } |
| 283 </pre> |
| 284 |
| 285 <h2 id="tips">Tips</h2> |
| 286 |
| 287 <p> |
| 288 For an effective New Tab page, follow these guidelines: |
| 289 </p> |
| 290 |
| 291 <ul> |
| 292 <li> |
| 293 <p> |
| 294 <b>Make your page quick and small.</b> <br> |
| 295 Because the New Tab page appears often, |
| 296 its performance is important. |
| 297 For example, avoid synchronous fetches of network or database resources. |
| 298 </p> |
| 299 </li> |
| 300 <li> |
| 301 <p> |
| 302 <b>Include a title in your page.</b> <br> |
| 303 Otherwise people will see the URL of the page, |
| 304 which might confuse them. |
| 305 Here's an example of specifying the title: |
| 306 <code><title>New Tab</title></code> |
| 307 </p> |
| 308 |
| 309 </li><li> |
| 310 <p> |
| 311 <b>Don't rely on the page having the keyboard focus.</b> <br> |
| 312 The address bar always gets the focus first |
| 313 when the user creates a new tab. |
| 314 </p> |
| 315 </li> |
| 316 <li> |
| 317 <p> |
| 318 <b>Don't try to emulate the default New Tab page.</b> <br> |
| 319 The APIs necessary to create |
| 320 a slightly modified version of the default New Tab page — |
| 321 with top pages, |
| 322 recently closed pages, |
| 323 tips, |
| 324 a theme background image, |
| 325 and so on — |
| 326 don't exist yet. |
| 327 Until they do, |
| 328 you're better off trying to make something completely different. |
| 329 </p> |
| 330 </li> |
| 331 </ul> |
| 332 |
| 333 <h2 id="examples">Examples</h2> |
| 334 |
| 335 <p> |
| 336 For an example of specifying a very simple New Tab page, |
| 337 see the |
| 338 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/test/data/extens
ions/samples/override_igoogle/">override_igoogle</a> sample. |
| 339 It uses a 3-line file named <code>redirect.html</code> |
| 340 to implement the New Tab page. |
| 341 </p> |
| 342 |
| 343 <p class="comment"> |
| 344 [PENDING: Maybe have a gallery of NTPs?] |
| 345 </p> |
| 346 </div> |
| 347 |
| 348 <!-- API PAGE --> |
| 349 <div class="apiPage" style="display: none; "> |
| 350 <a name="apiReference"></a> |
| 351 <h2>API reference: chrome.apiname </h2> |
| 352 |
| 353 <!-- PROPERTIES --> |
| 354 <div class="apiGroup"> |
| 355 <a name="properties"></a> |
| 356 <h3 id="properties">Properties</h3> |
| 357 |
| 358 <div> |
| 359 <a></a> |
| 360 <h4>getLastError</h4> |
| 361 <div class="summary"> |
| 362 <!-- Note: intentionally longer 80 columns --> |
| 363 <span>chrome.extension</span><span>lastError</span> |
| 364 </div> |
| 365 <div> |
| 366 </div> |
| 367 </div> |
| 368 |
| 369 </div> <!-- /apiGroup --> |
| 370 |
| 371 <!-- METHODS --> |
| 372 <div class="apiGroup" id="methods"> |
| 373 <a name="methods"></a> |
| 374 <h3>Methods</h3> |
| 375 |
| 376 <!-- iterates over all functions --> |
| 377 <div class="apiItem"> |
| 378 <a></a> <!-- method-anchor --> |
| 379 <h4>method name</h4> |
| 380 |
| 381 <div class="summary"><span>void</span> |
| 382 <!-- Note: intentionally longer 80 columns --> |
| 383 <span>chrome.module.methodName</span>(<span><span>, </span><sp
an></span> |
| 384 <var><span></span></var></span>)</div> |
| 385 |
| 386 <div class="description"> |
| 387 <p class="todo">Undocumented.</p> |
| 388 <p> |
| 389 A description from the json schema def of the function goes he
re. |
| 390 </p> |
| 391 |
| 392 <!-- PARAMETERS --> |
| 393 <h4>Parameters</h4> |
| 394 <dl> |
| 395 <div> |
| 396 <div> |
| 397 </div> |
| 398 </div> |
| 399 </dl> |
| 400 |
| 401 <!-- RETURNS --> |
| 402 <h4>Returns</h4> |
| 403 <dl> |
| 404 <div> |
| 405 <div> |
| 406 </div> |
| 407 </div> |
| 408 </dl> |
| 409 |
| 410 <!-- CALLBACK --> |
| 411 <div> |
| 412 <div> |
| 413 <h4>Callback function</h4> |
| 414 <p> |
| 415 If you specify the <em>callback</em> parameter, |
| 416 it should specify a function that looks like this: |
| 417 </p> |
| 418 |
| 419 <!-- Note: intentionally longer 80 columns --> |
| 420 <pre>function(<span>Type param1, Type param2</span>) <span cla
ss="subdued">{...}</span>);</pre> |
| 421 <dl> |
| 422 <div> |
| 423 <div> |
| 424 </div> |
| 425 </div> |
| 426 </dl> |
| 427 </div> |
| 428 </div> |
| 429 |
| 430 </div> <!-- /description --> |
| 431 |
| 432 </div> <!-- /apiItem --> |
| 433 |
| 434 </div> <!-- /apiGroup --> |
| 435 |
| 436 <!-- EVENTS --> |
| 437 <div class="apiGroup"> |
| 438 <a name="events"></a> |
| 439 <h3 id="events">Events</h3> |
| 440 |
| 441 <!-- iterates over all events --> |
| 442 <div class="apiItem"> |
| 443 <a></a> |
| 444 <h4>event name</h4> |
| 445 |
| 446 <div class="summary"> |
| 447 <!-- Note: intentionally longer 80 columns --> |
| 448 <span class="subdued">chrome.bookmarks</span><span>onEvent</span
><span class="subdued">.addListener</span>(function(<span>Type param1, Type para
m2</span>) <span class="subdued">{...}</span>); |
| 449 </div> |
| 450 |
| 451 <div class="description"> |
| 452 <p class="todo">Undocumented.</p> |
| 453 <p> |
| 454 A description from the json schema def of the event goes here. |
| 455 </p> |
| 456 |
| 457 <!-- PARAMETERS --> |
| 458 <h4>Parameters</h4> |
| 459 <dl> |
| 460 <div> |
| 461 <div> |
| 462 </div> |
| 463 </div> |
| 464 </dl> |
| 465 |
| 466 </div> <!-- /decription --> |
| 467 |
| 468 </div> <!-- /apiItem --> |
| 469 |
| 470 </div> <!-- /apiGroup --> |
| 471 |
| 472 <!-- TYPES --> |
| 473 <div class="apiGroup"> |
| 474 <a name="types.sort(sortByName)"></a> |
| 475 <h3 id="types">Types</h3> |
| 476 |
| 477 <!-- iterates over all types --> |
| 478 <div class="apiItem"> |
| 479 <a></a> |
| 480 <h4>type name</h4> |
| 481 |
| 482 <div> |
| 483 </div> |
| 484 |
| 485 </div> <!-- /apiItem --> |
| 486 |
| 487 </div> <!-- /apiGroup --> |
| 488 |
| 489 </div> <!-- /apiPage --> |
| 490 </div> <!-- /mainColumn --> |
| 491 </div> <!-- /pageContent --> |
| 492 <div id="pageFooter" --=""> |
| 493 <p> |
| 494 Except as otherwise <a href="http://code.google.com/policies.html#restrictions
">noted</a>, |
| 495 the content of this page is licensed under the <a rel="license" href="http://c
reativecommons.org/licenses/by/3.0/">Creative Commons |
| 496 Attribution 3.0 License</a>, and code samples are licensed under the |
| 497 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic
ense</a>. |
| 498 </p> |
| 499 <p> |
| 500 ©2009 Google |
| 501 </p> |
| 502 |
| 503 <!-- begin analytics --> |
| 504 <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"><
/script> |
| 505 <script src="http://www.google-analytics.com/ga.js" type="text/javascript"></scr
ipt> |
| 506 |
| 507 <script type="text/javascript"> |
| 508 // chrome doc tracking |
| 509 try { |
| 510 var engdocs = _gat._getTracker("YT-10763712-2"); |
| 511 engdocs._trackPageview(); |
| 512 } catch(err) {} |
| 513 |
| 514 // code.google.com site-wide tracking |
| 515 try { |
| 516 _uacct="UA-18071-1"; |
| 517 _uanchor=1; |
| 518 _uff=0; |
| 519 urchinTracker(); |
| 520 } |
| 521 catch(e) {/* urchinTracker not available. */} |
| 522 </script> |
| 523 <!-- end analytics --> |
| 524 |
| 525 </div> <!-- /pageFooter --> |
| 526 </div> <!-- /container --> |
| 527 </body></html> |
| 528 |
OLD | NEW |