Unthrottled chrome.notifications.create calls on every webRequest event, price-check tick, or polling cycle flood the OS notification center with dozens of popups per minute. Users disable notifications at the OS level, uninstall the extension, or leave one-star reviews citing spam. On macOS and Windows, excessive notifications also trigger system-level rate limiting that silently drops later — potentially important — alerts. Chrome Web Store reviewers flag notification-spamming extensions during policy review and may reject updates.
Critical because notification spam triggers uninstalls, one-star reviews, and Chrome Web Store policy rejection.
Gate every chrome.notifications.create call behind a timestamp check so notifications fire at most once per cooldown window, and batch high-frequency events into a summary. Put the throttle in the background service worker at background.js:
let last = 0;
const COOLDOWN = 30_000;
function maybeNotify(title, message) {
if (Date.now() - last < COOLDOWN) return;
last = Date.now();
chrome.notifications.create({ type: 'basic', iconUrl: 'icons/48.png', title, message });
}
ID: extension-ux-performance.badge-notifications.notifications-throttled
Severity: critical
What to look for: Examine all chrome.notifications.create calls in the background script. Check whether notifications are rate-limited (minimum interval between notifications), batched (multiple events grouped into one notification), or deduplicated (same notification not sent twice for the same event). Look for notification queues, throttle patterns, or conditions that gate notification dispatch. Count all instances found and enumerate each.
Pass criteria: Notifications are rate-limited so no more than one notification fires within a minimum interval (at least 10 seconds between notifications for the same event type), OR multiple events within a window are batched into a single summary notification. A visible throttle or debounce mechanism exists in code.
Fail criteria: Notifications fire for every event with no throttling — e.g., a notification for every incoming item, every price change tick, or every background check cycle. No batching, deduplication, or rate limiting found.
Skip (N/A) when: The extension does not use chrome.notifications API at all (no notification permission in manifest).
Detail on fail: Describe the spam pattern. Example: "chrome.notifications.create called on every webRequest event — can fire 100+ times per minute on active browsing" or "Price check runs every 60s and fires a notification on every run regardless of whether the value changed."
Remediation: Implement throttling or batching for notifications:
let lastNotificationTime = 0;
const NOTIFICATION_COOLDOWN_MS = 30_000; // 30 seconds minimum
function maybeNotify(title, message) {
const now = Date.now();
if (now - lastNotificationTime < NOTIFICATION_COOLDOWN_MS) return;
lastNotificationTime = now;
chrome.notifications.create({
type: 'basic',
iconUrl: 'icons/icon48.png',
title,
message,
});
}
For high-frequency events, collect them and send a summary: "5 new items since last check."