fregante/webext-permission-toggle

Update toggle when permissions change via events

开放

#36 创建于 2024年1月21日

 (1 条评论) (1 个反应) (0 位负责人)TypeScript (8 个派生)github user discovery
enhancementhelp wanted

仓库指标

星标
 (76 个星标)
PR 合并指标
 (平均合并 4分钟) (30 天内合并 2 个 PR)

描述

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"

贡献者指南