mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-17 15:53:59 -06:00
[PR #18432] [MERGED] fix: correctly handle clipboard images with {{CLIPBOARD}} in prompts #47841
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/18432
Author: @silentoplayz
Created: 10/20/2025
Status: ✅ Merged
Merged: 10/28/2025
Merged by: @tjbck
Base:
dev← Head:fix-clipboard-image-paste📝 Commits (1)
0031fb8fix: correctly handle clipboard images in prompts📊 Changes
1 file changed (+15 additions, -14 deletions)
View changed files
📝
src/lib/components/chat/MessageInput.svelte(+15 -14)📄 Description
Before submitting, make sure you've checked the following:
devbranch. Not targeting thedevbranch may lead to immediate closure of the PR.Changelog Entry
Description
{{CLIPBOARD}}prompt variable were not being handled correctly. The issue stemmed from the image data being passed as a blob URL instead of the required base64-encoded data URL, leading to backend processing errors. The fix ensures that clipboard images are properly converted to base64 before being sent, resolving the bug and improving clipboard functionality, especially for Firefox users.Changed
textVariableHandlerfunction insrc/lib/components/chat/MessageInput.svelteto useFileReader.readAsDataURL()for encoding clipboard images.navigator.clipboard.read()to gracefully manage clipboard permission issues.Fixed
'url' field must be a base64 encoded image" error by ensuring pasted images are correctly formatted.400: illegal base64 data at input byte 4" error by providing a valid base64 string to the backend.messages[0].content must be a string" error by ensuring the message payload is correctly constructed.DOMExceptionin Firefox related to clipboard read permissions.Additional Information
{{CLIPBOARD}}variable with the directCtrl+Vpaste functionality, creating a more consistent user experience.Testing
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
translations of the new items added in the last version have been carried out.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.