mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-27 13:29:34 +07:00
permissions.addHostAccessRequest() Demo
This sample demonstrates using the permissions.addHostAccessRequest API to request access to a host.
Overview
This API allows you to request access to an origin listed in optional_host_permissions (or withheld by the user) at runtime.
Running this extension
- Clone this repository.
- Make sure you have the latest version of Chrome Canary installed.
- At chrome://flags, enable the "Extensions Menu Access Control" flag.
- Restart Chrome Canary.
- Load this directory as an unpacked extension.
- At chrome://extensions, click on "Details" for the extension and unselect "Automatically allow access on the following sites".
- Visit https://example.com/checkout.
- Click "Allow 1?"
You will see a banner injected on the page to show that the extension has run.