notifications

The notifications permission allows an extension to create and show desktop notifications to the user.

What it does

  • Display rich notifications outside of the browser window, using the operating system's native notification system.
  • Notifications can include a title, message, icon, and buttons with custom actions.
  • Extensions can create, update, and clear notifications programmatically.
  • Can listen for events, such as when a notification is closed or when a user clicks on a button within the notification.

When to use it

Use this to alert users about important events, even if the browser window is not in focus.

Examples:

  • A mail checker extension that shows a notification for new emails.
  • A timer or reminder extension that notifies the user when time is up.
  • A "download complete" notification from an extension that manages downloads.
  • A social media extension that alerts the user to new messages or mentions.

Manifest Declaration

{
  "name": "My Notifier Extension",
  "version": "1.0",
  "manifest_version": 3,
  "permissions": [
    "notifications"
  ],
  "background": {
    "service_worker": "background.js"
  }
}

Security & Privacy

Why is it not risky?

This permission allows an extension to show you desktop notifications. For example, an email extension might notify you when you have a new message.

This is a safe permission. While a spammy extension could be annoying by showing too many notifications, it cannot access your personal data or harm your computer. You can usually manage an extension's notification settings from your browser or operating system.

API Usage Example

This example creates a simple notification when the user clicks the extension's icon.

// background.js

chrome.action.onClicked.addListener(() => {
  const notificationId = 'my-first-notification';

  chrome.notifications.create(notificationId, {
    type: 'basic',
    iconUrl: 'images/icon48.png',
    title: 'Hello!',
    message: 'This is a notification from my extension.',
    priority: 2
  }, (id) => {
    console.log("Notification created with ID:", id);
  });
});

Extensions with the notifications permission

Here are some popular browser extensions that use the "notifications" permission. To explore more, try our Advanced search.

Permission Metrics

Popularity

Security Risk


Usage by Platform