OLD | NEW |
1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc.
Note: | 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 | 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 | 3 across api docs and should be edited only with knowledge of the |
4 templating mechanism. | 4 templating mechanism. |
5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a | 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 | 6 browser, it will be re-generated from the template, json schema and |
7 authored overview content. | 7 authored overview content. |
8 4) The <body>.innerHTML is also generated by an offline step so that this | 8 4) The <body>.innerHTML is also generated by an offline step so that this |
9 page may easily be indexed by search engines. | 9 page may easily be indexed by search engines. |
10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> | 10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> |
11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | 11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> | 12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> |
13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> | 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"> | 14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla
te_compiled.js"> |
15 </script> | 15 </script> |
16 <script type="text/javascript" src="../../../../third_party/json_minify/mini
fy-sans-regexp.js"> | 16 <script type="text/javascript" src="../../../../third_party/json_minify/mini
fy-sans-regexp.js"> |
17 </script> | 17 </script> |
18 <script type="text/javascript" src="js/api_page_generator.js"></script> | 18 <script type="text/javascript" src="js/api_page_generator.js"></script> |
19 <script type="text/javascript" src="js/bootstrap.js"></script> | 19 <script type="text/javascript" src="js/bootstrap.js"></script> |
20 <script type="text/javascript" src="js/sidebar.js"></script> | 20 <script type="text/javascript" src="js/sidebar.js"></script> |
21 <title>chrome.* APIs - Google Chrome Extensions - Google Code</title></head> | 21 <meta name="description" content="Documentation for the chrome.topSites module
, which is part of the Google Chrome extension APIs."><title>chrome.topSites -
Google Chrome Extensions - Google Code</title></head> |
22 <body> <div id="devModeWarning" class="displayModeWarning"> | 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. | 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> | 24 </div> |
25 <div id="branchWarning" class="displayModeWarning"> | 25 <div id="branchWarning" class="displayModeWarning"> |
26 <span>WARNING: This is the <span id="branchName">BETA</span> documentation. | 26 <span>WARNING: This is the <span id="branchName">BETA</span> documentation. |
27 It may not work with the stable release of Chrome.</span> | 27 It may not work with the stable release of Chrome.</span> |
28 <select id="branchChooser"> | 28 <select id="branchChooser"> |
29 <option>Choose a different version... | 29 <option>Choose a different version... |
30 </option><option value="">Stable | 30 </option><option value="">Stable |
31 </option><option value="beta">Beta | 31 </option><option value="beta">Beta |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 </li> | 158 </li> |
159 <li><h2>Reference</h2> | 159 <li><h2>Reference</h2> |
160 <ul> | 160 <ul> |
161 <li>Formats | 161 <li>Formats |
162 <ul> | 162 <ul> |
163 <li><a href="manifest.html">Manifest Files</a></li> | 163 <li><a href="manifest.html">Manifest Files</a></li> |
164 <li><a href="match_patterns.html">Match Patterns</a></li> | 164 <li><a href="match_patterns.html">Match Patterns</a></li> |
165 </ul> | 165 </ul> |
166 </li> | 166 </li> |
167 <li><a href="permission_warnings.html">Permission Warnings</a></li
> | 167 <li><a href="permission_warnings.html">Permission Warnings</a></li
> |
168 <li class="leftNavSelected">chrome.* APIs</li> | 168 <li><a href="api_index.html">chrome.* APIs</a></li> |
169 <li><a href="api_other.html">Other APIs</a></li> | 169 <li><a href="api_other.html">Other APIs</a></li> |
170 </ul> | 170 </ul> |
171 </li> | 171 </li> |
172 <li><h2><a href="samples.html">Samples</a></h2></li> | 172 <li><h2><a href="samples.html">Samples</a></h2></li> |
173 <div class="line"> </div> | 173 <div class="line"> </div> |
174 <li><h2>More</h2> | 174 <li><h2>More</h2> |
175 <ul> | 175 <ul> |
176 <li><a href="http://code.google.com/chrome/webstore/docs/index.htm
l">Chrome Web Store</a></li> | 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> | 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> | 178 <li><a href="themes.html">Themes</a></li> |
179 </ul> | 179 </ul> |
180 </li> | 180 </li> |
181 </ul> | 181 </ul> |
182 </div> | 182 </div> |
183 <script> | 183 <script> |
184 initToggles(); | 184 initToggles(); |
185 </script> | 185 </script> |
186 <div class="g-unit" id="gc-pagecontent"> | 186 <div class="g-unit" id="gc-pagecontent"> |
187 <div id="pageTitle"> | 187 <div id="pageTitle"> |
188 <h1 class="page_title">chrome.* APIs</h1> | 188 <h1 class="page_title">chrome.topSites</h1> |
189 </div> | 189 </div> |
190 <!-- TABLE OF CONTENTS --> | 190 <!-- TABLE OF CONTENTS --> |
191 <div id="toc"> | 191 <div id="toc"> |
192 <h2>Contents</h2> | 192 <h2>Contents</h2> |
193 <ol> | 193 <ol> |
194 <li> | 194 <li> |
195 <a href="#supported">Supported APIs</a> | 195 <a href="#manifest">Notes</a> |
196 <ol> | 196 <ol> |
197 </ol> | 197 </ol> |
198 </li><li> | 198 </li><li> |
199 <a href="#experimental">Experimental APIs</a> | 199 <a href="#manifest">Manifest</a> |
200 <ol> | 200 <ol> |
201 </ol> | 201 </ol> |
202 </li><li> | 202 </li><li> |
203 <a href="#conventions">API conventions</a> | 203 <a href="#examples">Examples</a> |
204 <ol> | 204 <ol> |
205 </ol> | 205 </ol> |
206 </li> | 206 </li> |
| 207 <li> |
| 208 <a href="#apiReference">API reference: chrome.topSites</a> |
| 209 <ol> |
| 210 <li> |
| 211 <a href="#global-methods">Methods</a> |
| 212 <ol> |
| 213 <li> |
| 214 <a href="#method-get">get</a> |
| 215 </li> |
| 216 </ol> |
| 217 </li> |
| 218 <li> |
| 219 <a href="#types">Types</a> |
| 220 <ol> |
| 221 <li> |
| 222 <a href="#type-MostVisitedURL">MostVisitedURL</a> |
| 223 <ol> |
| 224 </ol> |
| 225 </li> |
| 226 </ol> |
| 227 </li> |
| 228 </ol> |
| 229 </li> |
207 </ol> | 230 </ol> |
208 </div> | 231 </div> |
209 <!-- /TABLE OF CONTENTS --> | 232 <!-- /TABLE OF CONTENTS --> |
210 <!-- Standard content lead-in for experimental API pages --> | 233 <!-- Standard content lead-in for experimental API pages --> |
211 <!-- STATIC CONTENT PLACEHOLDER --> | 234 <!-- STATIC CONTENT PLACEHOLDER --> |
212 <div id="static"><div id="pageData-name" class="pageData">chrome.* APIs<
/div> | 235 <div id="static"><!-- BEGIN AUTHORED CONTENT --> |
213 <div id="pageData-showTOC" class="pageData">true</div> | 236 <h2 id="manifest">Notes</h2> |
214 <p> | 237 <p> |
215 Google Chrome provides APIs such as | 238 The top sites module allows access to the top sites that are displayed on |
216 <code>chrome.bookmarks</code> and <code>chrome.tab</code> | 239 the new tab page. |
217 so that extensions can interact with the browser. | |
218 </p> | 240 </p> |
219 <h2 id="supported">Supported APIs</h2> | 241 <h2 id="manifest">Manifest</h2> |
220 <p> | 242 <p> |
221 Here are the supported chrome.* APIs: | 243 You must declare the "topSites" permission in your extension's manifest |
| 244 to use this API. |
222 </p> | 245 </p> |
223 <ul> | 246 <pre>{ |
224 <li><a href="bookmarks.html" js="">bookmarks</a></li><li><a href="browserActio
n.html" js="">browserAction</a></li><li><a href="browsingData.html" js="">browsi
ngData</a></li><li><a href="contentSettings.html" js="">contentSettings</a></li>
<li><a href="contextMenus.html" js="">contextMenus</a></li><li><a href="cookies.
html" js="">cookies</a></li><li><a href="debugger.html" js="">debugger</a></li><
li><a href="extension.html" js="">extension</a></li><li><a href="fileBrowserHand
ler.html" js="">fileBrowserHandler</a></li><li><a href="history.html" js="">hist
ory</a></li><li><a href="i18n.html" js="">i18n</a></li><li><a href="idle.html" j
s="">idle</a></li><li><a href="input.ime.html" js="">input.ime</a></li><li><a hr
ef="management.html" js="">management</a></li><li><a href="omnibox.html" js="">o
mnibox</a></li><li><a href="pageAction.html" js="">pageAction</a></li><li><a hre
f="pageCapture.html" js="">pageCapture</a></li><li><a href="permissions.html" js
="">permissions</a></li><li><a href="privacy.html" js="">privacy</a></li><li><a
href="proxy.html" js="">proxy</a></li><li><a href="storage.html" js="">storage</
a></li><li><a href="tabs.html" js="">tabs</a></li><li><a href="tts.html" js="">t
ts</a></li><li><a href="ttsEngine.html" js="">ttsEngine</a></li><li><a href="typ
es.html" js="">types</a></li><li><a href="webNavigation.html" js="">webNavigatio
n</a></li><li><a href="webRequest.html" js="">webRequest</a></li><li><a href="we
bstore.html" js="">webstore</a></li><li><a href="windows.html" js="">windows</a>
</li> | 247 "name": "My extension", |
225 </ul> | 248 ... |
226 <h2 id="experimental">Experimental APIs</h2> | 249 <b> "permissions": [ |
| 250 "topSites", |
| 251 ]</b>, |
| 252 ... |
| 253 }</pre> |
| 254 <h2 id="examples">Examples</h2> |
227 <p> | 255 <p> |
228 Google Chrome also has | 256 You can find samples of this API in |
229 <a href="experimental.html">experimental APIs</a>, | 257 <a href="samples.html#topsites">Samples</a>. |
230 some of which will become supported APIs | |
231 in future releases of Chrome. | |
232 </p> | 258 </p> |
233 <h2 id="conventions">API conventions</h2> | 259 <!-- END AUTHORED CONTENT --> |
234 <p> | |
235 Unless the doc says otherwise, | |
236 methods in the chrome.* APIs are <b>asynchronous</b>: | |
237 they return immediately, | |
238 without waiting for the operation to finish. | |
239 If you need to know the outcome of an operation, | |
240 then you pass a callback function into the method. | |
241 For more information, watch this video: | |
242 </p> | |
243 <p> | |
244 <iframe title="YouTube video player" width="640" height="390" src="http://www.yo
utube.com/embed/bmxr75CV36A?rel=0" frameborder="0" allowfullscreen=""></iframe> | |
245 </p> | |
246 </div> | 260 </div> |
247 <!-- API PAGE --> | 261 <!-- API PAGE --> |
248 <!-- /apiPage --> | 262 <div class="apiPage"> |
| 263 <a name="apiReference"></a> |
| 264 <h2>API reference: chrome.topSites</h2> |
| 265 <!-- PROPERTIES --> |
| 266 <!-- /apiGroup --> |
| 267 <!-- METHODS --> |
| 268 <div id="methodsTemplate" class="apiGroup"> |
| 269 <a name="global-methods"></a> |
| 270 <h3>Methods</h3> |
| 271 <!-- iterates over all functions --> |
| 272 <div class="apiItem"> |
| 273 <a name="method-get"></a> <!-- method-anchor --> |
| 274 <h4>get</h4> |
| 275 <div class="summary"> |
| 276 <!-- Note: intentionally longer 80 columns --> |
| 277 <span>chrome.topSites.get</span>(<span class="null"><span>func
tion</span> |
| 278 <var><span>callback</span></var></span>)</div> |
| 279 <div class="description"> |
| 280 <p>Gets a list of top sites.</p> |
| 281 <!-- PARAMETERS --> |
| 282 <h4>Parameters</h4> |
| 283 <dl> |
| 284 <div> |
| 285 <div> |
| 286 <dt> |
| 287 <var>callback</var> |
| 288 <em> |
| 289 <!-- TYPE --> |
| 290 <div style="display:inline"> |
| 291 ( |
| 292 <span id="typeTemplate"> |
| 293 <span> |
| 294 <span>function</span> |
| 295 </span> |
| 296 </span> |
| 297 ) |
| 298 </div> |
| 299 </em> |
| 300 </dt> |
| 301 <dd class="todo"> |
| 302 Undocumented. |
| 303 </dd> |
| 304 <!-- OBJECT PROPERTIES --> |
| 305 <!-- OBJECT METHODS --> |
| 306 <!-- OBJECT EVENT FIELDS --> |
| 307 <!-- FUNCTION PARAMETERS --> |
| 308 </div> |
| 309 </div> |
| 310 </dl> |
| 311 <!-- RETURNS --> |
| 312 <dl> |
| 313 </dl> |
| 314 <!-- CALLBACK --> |
| 315 <div> |
| 316 <div> |
| 317 <h4>Callback function</h4> |
| 318 <p> |
| 319 The callback <em>parameter</em> should specify a function |
| 320 that looks like this: |
| 321 </p> |
| 322 <!-- Note: intentionally longer 80 columns --> |
| 323 <pre>function(<span>array of MostVisitedURL data</span>) <span
class="subdued">{...}</span>;</pre> |
| 324 <dl> |
| 325 <div> |
| 326 <div> |
| 327 <dt> |
| 328 <var>data</var> |
| 329 <em> |
| 330 <!-- TYPE --> |
| 331 <div style="display:inline"> |
| 332 ( |
| 333 <span id="typeTemplate"> |
| 334 <span> |
| 335 <span> |
| 336 array of <span><span> |
| 337 <span> |
| 338 <a href="topSites.html#type-MostVisitedURL">MostVisitedU
RL</a> |
| 339 </span> |
| 340 </span></span> |
| 341 </span> |
| 342 </span> |
| 343 </span> |
| 344 ) |
| 345 </div> |
| 346 </em> |
| 347 </dt> |
| 348 <dd class="todo"> |
| 349 Undocumented. |
| 350 </dd> |
| 351 <!-- OBJECT PROPERTIES --> |
| 352 <!-- OBJECT METHODS --> |
| 353 <!-- OBJECT EVENT FIELDS --> |
| 354 <!-- FUNCTION PARAMETERS --> |
| 355 </div> |
| 356 </div> |
| 357 </dl> |
| 358 </div> |
| 359 </div> |
| 360 <!-- MIN_VERSION --> |
| 361 </div> <!-- /description --> |
| 362 </div> <!-- /apiItem --> |
| 363 </div> <!-- /apiGroup --> |
| 364 <!-- EVENTS --> |
| 365 <!-- /apiGroup --> |
| 366 <!-- TYPES --> |
| 367 <div class="apiGroup"> |
| 368 <a name="types"></a> |
| 369 <h3 id="types">Types</h3> |
| 370 <!-- iterates over all types --> |
| 371 <div class="apiItem"> |
| 372 <a name="type-MostVisitedURL"></a> |
| 373 <h4>MostVisitedURL</h4> |
| 374 <div> |
| 375 <dt> |
| 376 <em> |
| 377 <!-- TYPE --> |
| 378 <div style="display:inline"> |
| 379 ( |
| 380 <span id="typeTemplate"> |
| 381 <span> |
| 382 <span>object</span> |
| 383 </span> |
| 384 </span> |
| 385 ) |
| 386 </div> |
| 387 </em> |
| 388 </dt> |
| 389 <dd>An object encapsulating a most visited URL, such as the URLs on th
e new tab page.</dd> |
| 390 <!-- OBJECT PROPERTIES --> |
| 391 <dd> |
| 392 <dl> |
| 393 <div> |
| 394 <div> |
| 395 <dt> |
| 396 <var>url</var> |
| 397 <em> |
| 398 <!-- TYPE --> |
| 399 <div style="display:inline"> |
| 400 ( |
| 401 <span id="typeTemplate"> |
| 402 <span> |
| 403 <span>string</span> |
| 404 </span> |
| 405 </span> |
| 406 ) |
| 407 </div> |
| 408 </em> |
| 409 </dt> |
| 410 <dd>The most visited URL.</dd> |
| 411 <!-- OBJECT PROPERTIES --> |
| 412 <!-- OBJECT METHODS --> |
| 413 <!-- OBJECT EVENT FIELDS --> |
| 414 <!-- FUNCTION PARAMETERS --> |
| 415 </div> |
| 416 </div><div> |
| 417 <div> |
| 418 <dt> |
| 419 <var>title</var> |
| 420 <em> |
| 421 <!-- TYPE --> |
| 422 <div style="display:inline"> |
| 423 ( |
| 424 <span id="typeTemplate"> |
| 425 <span> |
| 426 <span>string</span> |
| 427 </span> |
| 428 </span> |
| 429 ) |
| 430 </div> |
| 431 </em> |
| 432 </dt> |
| 433 <dd>The title of the page</dd> |
| 434 <!-- OBJECT PROPERTIES --> |
| 435 <!-- OBJECT METHODS --> |
| 436 <!-- OBJECT EVENT FIELDS --> |
| 437 <!-- FUNCTION PARAMETERS --> |
| 438 </div> |
| 439 </div> |
| 440 </dl> |
| 441 </dd> |
| 442 <!-- OBJECT METHODS --> |
| 443 <!-- OBJECT EVENT FIELDS --> |
| 444 <!-- FUNCTION PARAMETERS --> |
| 445 </div> |
| 446 </div> <!-- /apiItem --> |
| 447 </div> <!-- /apiGroup --> |
| 448 </div> <!-- /apiPage --> |
249 </div> <!-- /gc-pagecontent --> | 449 </div> <!-- /gc-pagecontent --> |
250 </div> <!-- /g-section --> | 450 </div> <!-- /g-section --> |
251 </div> <!-- /codesiteContent --> | 451 </div> <!-- /codesiteContent --> |
252 <div id="gc-footer" --=""> | 452 <div id="gc-footer" --=""> |
253 <div class="text"> | 453 <div class="text"> |
254 <p> | 454 <p> |
255 Except as otherwise <a href="http://code.google.com/policies.html#restrictions
">noted</a>, | 455 Except as otherwise <a href="http://code.google.com/policies.html#restrictions
">noted</a>, |
256 the content of this page is licensed under the <a rel="license" href="http://c
reativecommons.org/licenses/by/3.0/">Creative Commons | 456 the content of this page is licensed under the <a rel="license" href="http://c
reativecommons.org/licenses/by/3.0/">Creative Commons |
257 Attribution 3.0 License</a>, and code samples are licensed under the | 457 Attribution 3.0 License</a>, and code samples are licensed under the |
258 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic
ense</a>. | 458 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic
ense</a>. |
(...skipping 17 matching lines...) Expand all Loading... |
276 _uff=0; | 476 _uff=0; |
277 urchinTracker(); | 477 urchinTracker(); |
278 } | 478 } |
279 catch(e) {/* urchinTracker not available. */} | 479 catch(e) {/* urchinTracker not available. */} |
280 </script> | 480 </script> |
281 <!-- end analytics --> | 481 <!-- end analytics --> |
282 </div> | 482 </div> |
283 </div> <!-- /gc-footer --> | 483 </div> <!-- /gc-footer --> |
284 </div> <!-- /gc-container --> | 484 </div> <!-- /gc-container --> |
285 </body></html> | 485 </body></html> |
OLD | NEW |