MCPcopy Create free account
hub / github.com/027xiguapi/code-box / handler

Function handler

background/messages/icon.ts:6–15  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

4import type { PlasmoMessaging } from "@plasmohq/messaging"
5
6const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
7 const [tab] = await chrome.tabs.query({ currentWindow: true, active: true })
8 const { active } = req.body
9
10 if (active) {
11 chrome.action.setIcon({ tabId: tab.id, path: activeUrl }, () => {})
12 } else {
13 chrome.action.setIcon({ tabId: tab.id, path: defaultUrl }, () => {})
14 }
15}
16
17export default handler

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected