diff --git a/api-samples/topSites/README.md b/api-samples/topSites/README.md new file mode 100644 index 0000000000..87087972fc --- /dev/null +++ b/api-samples/topSites/README.md @@ -0,0 +1,13 @@ +# chrome.topSites + +This sample demonstrates using the `chrome.topSites` API to suggest which sites a user should visit. + +## Overview + +The extension replaces the user's new tab page, and uses `chrome.topSites.get` to display a link to a site to visit. + +## Running this extension + +1. Clone this repository. +2. Load this directory in Chrome as an [unpacked extension](https://developer.chrome.com/docs/extensions/mv3/getstarted/development-basics/#load-unpacked). +3. Enable the extension and open a new tab. diff --git a/api-samples/topSites/manifest.json b/api-samples/topSites/manifest.json new file mode 100644 index 0000000000..27d151b372 --- /dev/null +++ b/api-samples/topSites/manifest.json @@ -0,0 +1,10 @@ +{ + "name": "topSites API sample", + "version": "2", + "description": "An extension demonstrating the chrome.topSites API", + "chrome_url_overrides": { + "newtab": "newTab.html" + }, + "permissions": ["topSites"], + "manifest_version": 3 +} diff --git a/api-samples/topSites/newTab.css b/api-samples/topSites/newTab.css new file mode 100644 index 0000000000..6c070fb88c --- /dev/null +++ b/api-samples/topSites/newTab.css @@ -0,0 +1,28 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +html { + background-color: #ddd; +} + +#spacer { + height: 200px; +} + +#title { + color: #555; + font-weight: bold; + height: 200px; + vertical-align: middle; +} + +#mostVisitedThumb { + background-repeat: no-repeat; + height: 200px; + margin-left: 20px; + padding-left: 20px; + vertical-align: middle; + width: 212px; +} diff --git a/api-samples/topSites/newTab.html b/api-samples/topSites/newTab.html new file mode 100644 index 0000000000..5d3c0fda42 --- /dev/null +++ b/api-samples/topSites/newTab.html @@ -0,0 +1,34 @@ + + + + + + + + +