You are viewing extension docs in chrome via the 'file:' scheme: are you expecting to see local changes when you refresh? You'll need run chrome with --allow-file-access-from-files.
WARNING: This is the BETA documentation. It may not work with the stable release of Chrome.
WARNING: This is unofficial documentation. It may not work with the current release of Chrome.

Google Chrome Extensions (Labs)

chrome.topSites

Notes

The top sites module allows access to the top sites that are displayed on the new tab page.

Manifest

You must declare the "topSites" permission in your extension's manifest to use this API.

{
  "name": "My extension",
  ...
  "permissions": [
    "topSites",
  ],
  ...
}

Examples

You can find samples of this API in Samples.

API reference: chrome.topSites

Methods

get

chrome.topSites.get(function callback)

Gets a list of top sites.

Parameters

callback
( function )
Undocumented.

Callback function

The callback parameter should specify a function that looks like this:

function(array of MostVisitedURL data) {...};
data
( array of MostVisitedURL )
Undocumented.

Types

MostVisitedURL

( object )
An object encapsulating a most visited URL, such as the URLs on the new tab page.
url
( string )
The most visited URL.
title
( string )
The title of the page