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

Function handler

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

Source from the content-addressed store, hash-verified

1import { type PlasmoMessaging } from "@plasmohq/messaging"
2
3const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
4 try {
5 chrome.tabs.query({ active: true, currentWindow: true }, ([tab]) => {
6 const { active } = req.body
7
8 if (active) {
9 chrome.sidePanel.open({ tabId: tab.id })
10 }
11 })
12 } catch (error) {
13 console.error("Error toggling side panel:", error)
14 }
15}
16
17export default handler

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected