
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
chrome-notifications
Advanced tools
Helper for chrome.notifications API.
You can install this library using npm:
npm install chrome-notifications
createCreates and displays a notification.
import { Notifications } from "chrome-notifications";
const options = {
type: "basic",
title: "My Notification",
message: "This is a sample notification",
iconUrl: "icon.png",
};
Notifications.create(options, "my-notification-id", (notification) => {
console.log(notification);
});
// Output:
// Object{
// notificationId: "38fde96f-43b1-4736-969e-2da10417c024",
// type: "basic",
// title: "My Notification",
// message: "This is a sample notification",
// iconUrl: "icon.png"
// }
updateUpdates an existing notification.
import { Notifications } from "chrome-notifications";
const notificationId = "38fde96f-43b1-4736-969e-2da10417c024";
const newOptions = {
title: "Updated Notification",
message: "This is an updated notification",
};
Notifications.update(notificationId, newOptions, (notification) => {
console.log(notification);
});
// Output:
// Object{
// notificationId: "38fde96f-43b1-4736-969e-2da10417c024",
// type: "basic",
// title: "Updated Notification",
// message: "This is an updated notification",
// iconUrl: "icon.png"
// }
clearClears the specified notification.
import { Notifications } from "chrome-notifications";
const notificationId = "38fde96f-43b1-4736-969e-2da10417c024";
Notifications.clear(notificationId, (wasCleared) => {
console.log(wasCleared);
});
// Output: true
getAllRetrieves all the notifications of this app or extension.
import { Notifications } from "chrome-notifications";
Notifications.getAll().then((notifications) => {
console.log(notifications);
});
// Output:
// Array [
// Object {
// notificationId: "131aa054-c1b3-485b-a200-83bdcba8421c",
// active: true
// }
// ]
getPermissionLevelRetrieves whether the user has enabled notifications from this app or extension.
import { Notifications } from "chrome-notifications";
Notifications.getPermissionLevel().then((permissionLevel) => {
console.log(permissionLevel);
});
// Output:
// Object{
// level: "granted",
// isGranted: true,
// isDenied: false
// }
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Helper for chrome.notifications API.
We found that chrome-notifications demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.