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

Function handler

background/messages/screenshot.ts:3–17  ·  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 const tabs = await chrome.tabs.query({ currentWindow: true, active: true })
5 const tab = tabs[0]
6 chrome.tabs.captureVisibleTab(
7 tab.windowId,
8 {
9 format: "png"
10 },
11 (dataUrl) => {
12 res.send({
13 dataUrl: dataUrl
14 })
15 }
16 )
17}
18
19export default handler

Callers

nothing calls this directly

Calls 1

sendMethod · 0.80

Tested by

no test coverage detected