用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/KunanonJ/ai-skills-hub --skill aside-notification-activation命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | aside-notification-activation |
| description | Enable browser notifications on websites for monitoring and event-driven routine flows. |
| metadata | {"version":"0.1.0"} |
Enabling website notifications requires TWO steps — browser permission AND site-level opt-in. Both are mandatory; browser permission alone does nothing if the site hasn't been told to send notifications.
Before granting permission, check if this origin already has a notification grant:
// Query the daemon to see if we already granted notification permission for this origin
const origin = new URL(page.url()).origin;
const existing = await trpcClient.inbox.getNotificationGrant.query({ origin });
if (existing) {
// Already granted — skip to Step 2 (site-level opt-in) or Step 3 (source resolution)
}
If a grant already exists, skip Step 1 entirely. The browser already has "Allow for AI" permission for this origin. Proceed to Step 2 if site-level opt-in has not been done, then Step 3 before waiting.
await page.grantNotificationPermission();
Call this on the target site FIRST. This does two things:
After grantNotificationPermission() returns, wait for the page to settle before proceeding to Step 2.
This is the critical step. Most websites require you to opt in to desktop/browser/push notifications from their own settings page. The general strategy:
// Take a snapshot to orient — look for settings/gear icons, profile menus
await snapshot(page, { interactive: true });
// Common approaches:
// 1. Direct URL if known (check browsing history or guess common patterns)
// e.g. /settings/notifications, /preferences, /account/notifications
// 2. Click settings icon (gear) → look for "Notifications" section
// 3. Profile menu → Settings/Preferences → Notifications tab
// Snapshot the settings page — look for notification-related controls
await snapshot(page);
// Search for keywords in the snapshot:
// - "Desktop notifications", "Browser notifications", "Push notifications"
// - "Email notifications" (NOT this — we want push/desktop only)
// - Toggle switches, checkboxes, "Enable" / "Turn on" / "Allow" buttons
// - "New mail notifications" (Gmail-like), "Notify me about..." (Slack-like)
// Click the toggle/checkbox/button
await page.locator('<ref>').click();
// Snapshot diff to confirm state changed
const after = await snapshot(page);
// Verify the toggle shows "on" state or a success message appeared
page.grantNotificationPermission(), reload, retry.Before creating an event routine, resolve the user's site/service reference to the exact page origin. Never pass the user's raw phrase directly as eventFilter.from.
Resolution priority:
trpcClient.inbox.listNotificationGrants.query().Use the technical origin URL internally, but speak to the user in site/domain terms. Good: "I'll wait for Gmail site notifications." or "I'll wait for notifications from mail.google.com." Avoid exposing implementation wording like "origin subscription" unless the user asks.
If the user wants any browser notification classified, omit eventFilter.from and inspect the received event after wake. For a specific named site/service, resolve the site first and use the origin URL.
After browser permission, site-level opt-in, and source resolution succeed, create an event routine with routine_update:
For a one-shot wait that continues this conversation when the notification arrives ("wake me when the Gmail reply comes"):
mode: "create"
kind: "heartbeat" ← wakes this session
triggerKind: "event"
scheduleKind: "once" ← auto-pauses after the first matching event
eventFilter: { source: "web-push-notification", from: "<origin URL>" }
timeoutMinutes: 60 ← optional; defaults to 60 for once waits
name/prompt: what to do when the event (or timeout) arrives
Then end the turn normally — the session stays idle and is woken with the event content when a matching notification arrives, or with a timeout notice if the deadline passes.
For a standing monitor that starts a new task per notification, use kind: "cron" with scheduleKind: "recurring" instead.
eventFilter.from must be the page origin URL (e.g. https://mail.google.com, https://app.slack.com), NOT an email address or username. This is because the browser delivers push notifications tagged with the sending origin.