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