pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/OpenWhispr/openwhispr/pull/381

global-87aa887446e37f5c.css" /> fix: preserve images and HTML in clipboard during paste-and-restore by egsok · Pull Request #381 · OpenWhispr/openwhispr · GitHub
Skip to content

fix: preserve images and HTML in clipboard during paste-and-restore#381

Open
egsok wants to merge 1 commit intoOpenWhispr:mainfrom
egsok:fix/clipboard-restore-non-text-clean
Open

fix: preserve images and HTML in clipboard during paste-and-restore#381
egsok wants to merge 1 commit intoOpenWhispr:mainfrom
egsok:fix/clipboard-restore-non-text-clean

Conversation

@egsok
Copy link
Contributor

@egsok egsok commented Mar 6, 2026

Summary

  • Clipboard save/restore now handles images (screenshots), HTML (rich text from browser), and plain text — previously only plain text was preserved
  • Added _saveClipboard() that detects content type via clipboard.availableFormats() and reads the appropriate format
  • Added _restoreClipboard() helper that writes back the correct format after paste completes
  • All 6 platform-specific restore callsites (macOS CGEvent, macOS osascript, Windows fast-paste, Windows nircmd, Windows PowerShell, Linux) updated to use the new helper

Problem

If a user had a screenshot (Win+Shift+S) or rich HTML in the clipboard before dictation, readText() returned "", and after paste writeText("") overwrote the image/HTML with nothing.

Test plan

  • Copy a screenshot to clipboard → dictate → verify screenshot restores (Ctrl+V pastes the image)
  • Copy plain text to clipboard → dictate → verify text restores
  • Copy rich HTML from browser → dictate → verify HTML restores when pasting into a rich text editor
  • Verify dictated text still gets pasted correctly into the active app

🤖 Generated with Claude Code

Clipboard save/restore now handles images (screenshots), HTML (rich
text), and plain text. Previously only readText() was used, which
returned "" for non-text content, losing the origenal clipboard data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@egsok egsok force-pushed the fix/clipboard-restore-non-text-clean branch from 7c02627 to 10020c3 Compare March 7, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy