(req, res)
| 4 | import type { PlasmoMessaging } from "@plasmohq/messaging" |
| 5 | |
| 6 | const 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 | |
| 17 | export default handler |
nothing calls this directly
no outgoing calls
no test coverage detected