Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

chrome-badge

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

chrome-badge

Helper for displaying badges in chrome.action API.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

chrome-badge

npm version build License

Overview

Helper for displaying badges in chrome.action API.

Installation

You can install this library using npm:

npm install chrome-badge

Methods

set

Sets the text color and background color for badge of the action. The badge is displayed on top of the icon.

import { Badge } from "chrome-badge";

const text = "999";
const backgroundColor = "red";
const textColor = "white";

Badge.set({ text, textColor, backgroundColor });

get

Gets the badge text of the action. If no tab is specified, the non-tab-specific badge text is returned.

import { Alarm } from "chrome-alarms";

const badge = await Badge.get();
console.log(badge);

// Output:
//   Object{
//     backgroundColor: Array(4) [255, 0, 0, 255],
//     text: "999",
//     textColor: Array(4) [255, 255, 255, 255]
//   }
  • chrome.action

License

This project is licensed under the MIT License - see the LICENSE file for details.

Keywords

chrome

FAQs

Package last updated on 29 Jan 2024

Did you know?

Socket

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.

Install

Related posts