Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions functional-samples/sample.optional_permissions/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
## Optional permissions in a new tab

This new tab extension demonstrates how extensions can provide users the option to enable an additional feature. In this example, they optionally display top sites.
This extension prompts the user on the **New Tab** page asking permission to display their top sites. Demonstrates how extensions can provide users the option to enable additional features.

See [Optional permissions](https://developer.chrome.com/docs/extensions/reference/permissions/) to learn more.
See [optional permissions](https://developer.chrome.com/docs/extensions/reference/permissions/) to learn more.

## Testing the extension

Follow the instructions to load an [unpacked extension](https://developer.chrome.com/docs/extensions/mv3/getstarted/development-basics/#load-unpacked, then open a new tab.
Follow the instructions to load an [unpacked extension](https://developer.chrome.com/docs/extensions/mv3/getstarted/development-basics/#load-unpacked), then open a new tab.

It should look like this:

<img src="../../.repo/images/optional-permissions-new-tab.png" alt="New tab with the focus of the day and optional feature button" width="500"/>
<img src="../../.repo/images/optional-permissions-new-tab.png" alt="New tab with optional permission button" width="500"/>

Then, click on "Allow Extension to Access to top sites". You will see the following message:
Then, click on `Allow Extension to Access to Top Sites`. You will see the following message:

<img src="../../.repo/images/optional-permissions-dialog.png" alt="Allow permissions dialog" width="400"/>
<img src="../../.repo/images/optional-permissions-dialog.png" alt="Permissions prompt with Deny and Allow buttons respectively" width="400"/>

If you accept, it will display a list of your top sites.
Selecting `Allow` will display a list of the websites you visit most.

<img src="../../.repo/images/optional-permissions-top-sites.png" alt="New tab displaying top sites" width="400"/>
<img src="../../.repo/images/optional-permissions-top-sites.png" alt="New tab displaying favicons for top sites" width="400"/>