Bug 178010
Summary: | on Safari 10.12.6 event.dataTransfer.getData('URL') always returns empty | ||
---|---|---|---|
Product: | WebKit | Reporter: | Leonardo <mac.iphone.dev> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Major | CC: | rniwa, wenson_hsieh |
Priority: | P2 | ||
Version: | Safari 10 | ||
Hardware: | Mac | ||
OS: | macOS 10.12 |
Leonardo
macOS 10.12.6.
On Safari 10.1.2
The javascript command dataTransfer.getData('URL') returns empty while other browsers properly return the image I drag from the same HTML page. The code:
function handleDrop(e)
{
var imageUrl = e.dataTransfer.getData('URL');
console.log("handleDrop imageUrl: " + imageUrl);
}
The log is "handleDrop imageUrl:"
It's empty.
---------
Other browsers: Chrome Version 61.0.3163.100 (Official Build) (64-bit)
I did run the same test and I properly got the image URL, as
"handleDrop imageUrl:http://localhost/images/icn_logo.png"
It works even if I drag the image from another page/window from another web site, as
"handleDrop imageUrl:https://upload.wikimedia.org/wikipedia/commons/c/ce/Madonna_In_Gothenburg.jpg"
I get the URL with several types as
text/uri-list, Text, text/plain, URL
---------
Important!
If I drag the same image from the Safari web page/window onto a Chrome web page/window, it works.
If I drag the same image from the Chrome web page/window onto a Safari web page/window, it doesn't work.
So I suppose that the drag and drop on Safari properly stores the drag data but it can't read it from the dataTransfer object.
Thank you
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Wenson Hsieh
This should be fixed with http://trac.webkit.org/r221343. Are you able to reproduce on a nightly build?