Paste text/uri-list as files instead of links
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, enhancement)
Tracking
()
People
(Reporter: vaartis, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0
Steps to reproduce:
Pasted data from clipboard that has a MIME-type text/uri-list
Actual results:
Firefox pastes it as a link
Expected results:
Firefox uploads the file that the link refers to (or, perhaps, only uploads it if it's a file:// link). This already happens when drag-and-dropping text/uri-list. It would be logical to handle it the same way for copying-and-pasting.
Reporter | ||
Comment 1•4 years ago
|
||
Perhaps, this could also be extended to handle text/x-moz-url, which would potentially contain an alternative name of the file.
Comment 2•4 years ago
|
||
Hi,
I'm setting component to this enhancement to Core - Layout. Please set the right component in case is needed. Also I'm setting status to NEW.
Thanks.
Updated•4 years ago
|
Comment 3•4 years ago
|
||
Could you tell us how to reproduce the reported bug? (how to create the clipboard data? and where to paste the clipboard data?)
Reporter | ||
Comment 4•4 years ago
|
||
My concrete example would be any program which uses QMimeData and QApplication.clipboard().setMimeData(). The exact program that I found this do is hydrus, but it can probably be easily replicated as a standalone example using just these two types in Qt5/PyQt5. As about where to paste the clipboard data, that would be the fields that accept pasting or dropping files into them to upload these files. If I am not mistaken, the "pasting" is implemented via ClipboardEvent and is achieved by listening to the "paste" event, while dropping is achieved by listening to the "drop" event, both produce the DataTransfer object, with the "files" property, but when drag-and-dropping, the file:// urls are converted to "files" and when pasting they're not. The idea would be to convert these pasted file:// URLs to file data inside DataTransfer. There are more than one website that do it, my concrete example would be this but I'm pretty sure you can go on any social media website (e.g. twitter, facebook) and they would do the same thing.
Updated•4 years ago
|
Updated•3 years ago
|
Comment 5•3 years ago
|
||
In bug 1701319 I added support for pasting files on the GTK platform by parsing the text/uri-list
data. However without bug 1699743/bug 1308007 fixed we don't actually support pasting files on websites.
Description
•