MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / triggerDownload

Function triggerDownload

src/utils/snapCapture.ts:98–105  ·  view source on GitHub ↗
(href: string, filename: string)

Source from the content-addressed store, hash-verified

96}
97
98function triggerDownload(href: string, filename: string) {
99 const a = document.createElement('a')
100 a.href = href
101 a.download = filename
102 document.body.appendChild(a)
103 a.click()
104 a.remove()
105}
106
107/**
108 * 捕获元素为图片数据,返回 base64 字符串

Callers 1

captureAndDownloadPngFunction · 0.85

Calls 1

removeMethod · 0.65

Tested by

no test coverage detected