diff --git a/package.json b/package.json index d7388f3c..6a50e7f6 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "axios": "^1.3.5", "dnd-kit-sortable-tree": "^0.1.58", "endent": "^2.1.0", + "html2canvas": "^1.4.1", "jotai": "^2.4.3", "langchain": "^0.0.197-rc.1", "object-hash": "^3.0.0", diff --git a/src/components/Sidebar/chat/ImageCaptureButton.tsx b/src/components/Sidebar/chat/ImageCaptureButton.tsx index 1bb5c66f..d8c4442e 100644 --- a/src/components/Sidebar/chat/ImageCaptureButton.tsx +++ b/src/components/Sidebar/chat/ImageCaptureButton.tsx @@ -8,7 +8,7 @@ const ImageCaptureButton = ({ addMessageDraftFile, }: ImageCaptureButtonProps) => { const handleScreenshotClick = async () => { - const image = await new Promise((resolve) => { + const imageBlob: Blob = await new Promise((resolve) => { window.parent.postMessage({ action: 'get-screenshot-image' }, '*') window.addEventListener('message', function (event) { const { action, payload } = event.data @@ -17,8 +17,8 @@ const ImageCaptureButton = ({ } }) }) - console.log('image', image) - addMessageDraftFile(image as Blob) + + addMessageDraftFile(imageBlob as Blob) } return (