feross / feross/drag-drop

FileList and directories are empty in Chrome

Open
#66 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
482
Forks
60
PR merge metrics
No merged PRs in 30d

Description

When using Chrome, both the fileList object and the directories array passed to drag-drop's callback function appear to be empty. Firefox is still working fine, I haven't been able to test Safari as I don't have a Mac.
This was previously working; I assume some kind of new security enhancement on Chrome or WebKit is to blame.

To replicate:
HTML
```html

Drag & Drop

drag & drop here




```
app.js
```javascript
dragDrop('#input', (files, pos, fileList, directories) => {
console.log('Here are the dropped files', files);
console.log('Dropped at coordinates', pos.x, pos.y);
console.log('Here is the raw FileList object if you need it:', fileList);
console.log('Here is the list of directories:', directories);
});
```
Note console output on drag & drop:
```
Here are the dropped files
(3) [File, File, File]
0: File {fullPath: "/1.jpg", isFile: true, isDirectory: false, name: "1.jpg", lastModified: 1564034283085, …}
1: File {fullPath: "/2.jpg", isFile: true, isDirectory: false, name: "2.jpg", lastModified: 1564034283085, …}
2: File {fullPath: "/3.jpg", isFile: true, isDirectory: false, name: "3.jpg", lastModified: 1564034283085, …}
length: 3
[[Prototype]]: Array(0)

Dropped at coordinates 729 163

Here is the raw FileList object if you need it:
FileList {length: 0}
length: 0
[[Prototype]]: FileList

Here is the list of directories:
[]
length: 0
[[Prototype]]: Array(0)
```

Is this something that can be fixed? Or are whatever security change(s) responsible insurmountable?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the supplied HTML and app.js reproduction with drag-drop@7.2.0 in Chrome, comparing the callback's files, fileList, and directories with Firefox. Trace the dragDrop callback entry point and determine whether the raw FileList and directory results can still be populated; done means the reported Chrome behavior is fixed or documented as a browser security limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.