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"

貢獻者指南