mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-27 13:29:34 +07:00
* 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>
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
- Clone this repository.
- Load this directory in Chrome as an unpacked extension.
- Pin the extension to the taskbar and click the action button.