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

Function sendImageToChat

utils/chat-integration.ts:34–53  ·  view source on GitHub ↗
(images: string[])

Source from the content-addressed store, hash-verified

32 * @param images Base64 格式的图片数组
33 */
34export async function sendImageToChat(images: string[]) {
35 try {
36 const [tab] = await chrome.tabs.query({
37 active: true,
38 currentWindow: true
39 })
40
41 if (tab.id) {
42 await chrome.tabs.sendMessage(tab.id, {
43 action: "sendImageToChat",
44 images
45 })
46 return { success: true }
47 }
48 return { success: false, error: "No active tab" }
49 } catch (error) {
50 console.error("[Chat Integration] Error:", error)
51 return { success: false, error: error.message }
52 }
53}
54
55/**
56 * 截图并发送到聊天

Callers 1

captureAndSendToChatFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected