MCPcopy
hub / github.com/codeaashu/claude-code / send

Method send

web/lib/browser-notifications.ts:18–37  ·  view source on GitHub ↗
(options: BrowserNotificationOptions)

Source from the content-addressed store, hash-verified

16 }
17
18 async send(options: BrowserNotificationOptions): Promise<void> {
19 if (typeof window === "undefined") return;
20 if (!("Notification" in window)) return;
21 // Only notify when the tab is in the background
22 if (!document.hidden) return;
23
24 const granted = await this.requestPermission();
25 if (!granted) return;
26
27 const n = new Notification(options.title, {
28 body: options.body,
29 icon: "/favicon.ico",
30 });
31
32 n.onclick = () => {
33 window.focus();
34 options.onClick?.();
35 n.close();
36 };
37 }
38
39 getPermission(): NotificationPermission {
40 if (typeof window === "undefined") return "default";

Callers

nothing calls this directly

Calls 3

requestPermissionMethod · 0.95
focusMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected