Files
chrome-extensions-samples/api-samples/privacy
Oliver Dunk 72eb0a4a7d Update chrome.privacy API sample (#1086)
* Update chrome.privacy API sample

Updates the API sample for chrome.privacy to avoid using the
deprecated autofillEnabled property and to behave in a way which
is more useful. In particular, you can now easily toggle the
setting by clicking the extension icon.

See https://issuetracker.google.com/issues/311072505 for more
context.

* Update api-samples/privacy/README.md

Co-authored-by: Joe Medley <jmedley@google.com>

---------

Co-authored-by: Joe Medley <jmedley@google.com>
2024-02-22 15:45:21 +00:00
..

chrome.privacy

This sample demonstrates using chrome.privacy.services to get and set privacy settings.

Overview

The service worker sets the default value for autofill using chrome.privacy.services.autofillCreditCardEnabled.set() when the extension is installed. Whenever the action button is clicked, the extension toggles the current autofill setting of autofillCreditCardEnabled and updates the extension badge.

Running this extension

  1. Clone this repository.
  2. Load this directory in Chrome as an unpacked extension.
  3. Pin the extension to the taskbar and click the action button.