Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update toggle when permissions change via events #36

Open
fregante opened this issue Jan 21, 2024 · 1 comment
Open

Update toggle when permissions change via events #36

fregante opened this issue Jan 21, 2024 · 1 comment

Comments

@fregante
Copy link
Owner

While actions on click are being discussed in #33, there's an additional sanity check this module can run:

chrome.permissions.onAdded.addListener((newPermissions) => {
	1. get current active tabs (one per window)
	2. check if they match the new permission
	3. update their icon
});
// and onRemoved

This handles:

  • new permissions via webext-domain-permission-toggle
  • new permissions via other .request() paths
  • removed permissions via Chrome's UI
  • HOPEFULLY also permissions removed via "access site on click"
@aspiers
Copy link
Contributor

aspiers commented Jan 21, 2024

Just for reference actions on click are also discussed in fregante/webext-permissions#22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants