fix: do not cancel HTML or text paste when no image is in the event

Empty text/plain used to preventDefault before native clipboard read, which discarded HTML-only paste if no image was recovered.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-16 12:46:10 +08:00
parent 00209d55e6
commit d6a7a3ab08
3 changed files with 13 additions and 5 deletions

View File

@@ -46,10 +46,13 @@ class ClipboardIngestTests(unittest.TestCase):
self.assertIn("navigator.clipboard.read", chrome)
self.assertIn("read_clipboard_images", chrome)
self.assertIn("__dshDesktopIngesting", chrome)
self.assertIn('clipboardText(e, "text/html")', chrome)
self.assertNotIn(
'item.kind === "file" && item.getAsFile()',
chrome,
)
self.assertNotIn("steal", chrome)
self.assertNotIn("|| !String(text).trim()", chrome)
class BundledAttributionTests(unittest.TestCase):