(id, isClick)
| 59 | }); |
| 60 | |
| 61 | function notifyOpener(id, isClick) { |
| 62 | const op = openers[id]; |
| 63 | if (!op) return; |
| 64 | if (isFunction(op)) { |
| 65 | if (isClick) op(); |
| 66 | } else if (op > 0) { |
| 67 | if (isClick) clearZombieTimer(op); |
| 68 | } else if (op[kZombie]) { |
| 69 | if (isClick) { |
| 70 | commands.TabOpen({ url: op[kZombieUrl] }, op); |
| 71 | removeNotification(id); // Chrome doesn't auto-remove it on click |
| 72 | } |
| 73 | } else { |
| 74 | sendTabCmd(op.tab.id, isClick ? 'NotificationClick' : 'NotificationClose', id, { |
| 75 | [kFrameId]: op[kFrameId], |
| 76 | }); |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | export function clearNotifications(tabId, frameId, tabRemoved) { |
| 81 | for (const nid in openers) { |
no test coverage detected