MDN self-hosted library · e01.org
Notifications / notebook

Notifications

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
const title = browser.i18n.getMessage("notificationTitle");
const content = browser.i18n.getMessage("notificationContent", message.url);
browser.notifications.create({
  type: "basic",
  iconUrl: browser.runtime.getURL("icons/link-48.png"),
  title,
  message: content,
});
js
browser.notifications.onClicked.addListener(handleClick);