From 54e62b48e552d8b0a78d85d56081b5a6b7b88650 Mon Sep 17 00:00:00 2001 From: Joone Hur Date: Thu, 8 Jan 2026 14:32:36 -0800 Subject: [PATCH] Parse multiple URLs from text/uri-list drag data According to RFC 2483, Section 5, the text/uri-list MIME type supports multiple URLs separated by CRLF(\r\n). However, Chromium was not able to parse multiple URLs from a single text/uri-list string, treating the entire string as one invalid URL. This CL updates the drag-and-drop implementation to correctly support multiple URLs. It now parses the uri-list string by splitting on the newline character(\n) and applying base::TRIM_WHITESPACE, which robustly handles both \n and \r\n for better compatibility. In addition, this CL introduces the BookmarkList clipboard format for Windows, which contains a JSON array of URLs and titles. If the URL list has multiple entries, they are also stored using the new BookmarkList type on the Windows clipboard. See this design document for more details: https://docs.google.com/document/d/1zNvn2hQOfMCc9-L9_Wt-Q4rBhmSAQHhUYWMDdNKLCGU/edit?usp=sharing The below CLs were split from the original CL: - https://chromium-review.googlesource.com/c/chromium/src/+/7059146 - https://chromium-review.googlesource.com/c/chromium/src/+/7084017 Bug: 41011768 Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6608042 Reviewed-by: Thomas Anderson Commit-Queue: Joone Hur Cr-Commit-Position: refs/heads/main@{#1566533} --- clipboard-apis/drag-multiple-urls.html | 55 ++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 clipboard-apis/drag-multiple-urls.html diff --git a/clipboard-apis/drag-multiple-urls.html b/clipboard-apis/drag-multiple-urls.html new file mode 100644 index 00000000000000..fb0113a6f1d794 --- /dev/null +++ b/clipboard-apis/drag-multiple-urls.html @@ -0,0 +1,55 @@ + + + + + Drag and Drop: text/uri-list with multiple URLs + + + + +
Drag Me
+
Drop Here
+
+ + + + + \ No newline at end of file