Welcome What's new in Chrome extensions Getting started API Reference Samples
Welcome What's new in Chrome extensions Getting started API Reference Samples

chrome.topSites

  • Description

    Use the chrome.topSites API to access the top sites (i.e. most visited sites) that are displayed on the new tab page. These do not include shortcuts customized by the user.

  • Permissions
    topSites

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.

Summary

Types

MostVisitedURL

An object encapsulating a most visited URL, such as the default shortcuts on the new tab page.

Properties

  • title

    string

    The title of the page

  • url

    string

    The most visited URL.

Methods

get

chrome.topSites.get(
  callback?: function,
)
Promise

Gets a list of top sites.

Parameters

Returns

  • Promise<MostVisitedURL[]>

    Pending

    This only returns a Promise when the callback parameter is not specified, and with MV3+. The type inside the Promise is the same as the 1st argument to callback.

We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.