Bug 174259 - dataTransfer.getData("text/uri-list") for image on page returns nothing
Summary: dataTransfer.getData("text/uri-list") for image on page returns nothing
Status: RESOLVED DUPLICATE of bug 170637
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Safari 10
Hardware: Macintosh macOS 10.12
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-07 10:07 PDT by Zarema
Modified: 2017-07-10 07:07 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zarema 2017-07-07 10:07:32 PDT
On one page there is a block and an image (an `img` element). On the block there is an `ondrop` event handler. 

```
function drop(dropevent) {
    dropevent.preventDefault();
    var data = dropevent.dataTransfer.getData("text/uri-list");
    dropevent.target.innerText = data
}
```

In Safari 10.1, if you drag an image into this block, the `dataTransfer.getData("text/uri-list")` method returns nothing. In other browsers and previous version of Safari, this method returns the url of the image.

Demo on codepen: https://codepen.io/zmoki/pen/mwjgLG
Comment 1 Brady Eidson 2017-07-07 17:10:08 PDT
We have this internally as <rdar://problem/31347248>

Does this affect any websites that you know of?
Comment 2 Brady Eidson 2017-07-07 17:12:10 PDT

*** This bug has been marked as a duplicate of bug 170637 ***
Comment 3 Zarema 2017-07-10 03:05:33 PDT
Yes, this affects Uploadcare Widget (file picker, https://uploadcare.com/documentation/widget/). You can see it on the pages https://uploadcare.com/ and https://uploadcare.com/quick_start/. On these pages there is demo where you need to drag image onto the button.
Comment 4 Brady Eidson 2017-07-10 07:07:41 PDT
(In reply to Zarema from comment #3)
> Yes, this affects Uploadcare Widget (file picker,
> https://uploadcare.com/documentation/widget/). You can see it on the pages
> https://uploadcare.com/ and https://uploadcare.com/quick_start/. On these
> pages there is demo where you need to drag image onto the button.

I meant deployed sites in practice, but please feel free to keep commenting in the original bug (170637)