Parse multiple URLs from text/uri-list drag data #57082
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Bug: 41011768
Change-Id: I05feaa80a6db10e311c2e222281df4a22af7b5a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6608042
Reviewed-by: Thomas Anderson <[email protected]>
Commit-Queue: Joone Hur <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1566533}