fregante/webext-permission-toggle

Update toggle when permissions change via events

Ouverte

#36 ouverte le 21 janv. 2024

 (1 commentaire) (1 réaction) (0 personne assignée)TypeScript (8 forks)github user discovery
enhancementhelp wanted

Métriques du dépôt

Stars
 (76 étoiles)
Métriques de merge PR
 (Merge moyen 4m) (2 PRs mergées en 30 j)

Description

While actions on click are being discussed in https://github.com/fregante/webext-domain-permission-toggle/pull/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"

Guide contributeur