MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / notifyOpener

Function notifyOpener

src/background/utils/notifications.js:61–78  ·  view source on GitHub ↗
(id, isClick)

Source from the content-addressed store, hash-verified

59});
60
61function 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
80export function clearNotifications(tabId, frameId, tabRemoved) {
81 for (const nid in openers) {

Callers 1

notifications.jsFile · 0.85

Calls 4

sendTabCmdFunction · 0.90
isFunctionFunction · 0.85
clearZombieTimerFunction · 0.85
removeNotificationFunction · 0.85

Tested by

no test coverage detected