Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drag and drop example not working, Firefox 133.0.3 #37458

Open
mashdragon opened this issue Dec 31, 2024 · 2 comments
Open

Drag and drop example not working, Firefox 133.0.3 #37458

mashdragon opened this issue Dec 31, 2024 · 2 comments
Labels
Content:WebAPI Web API docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@mashdragon
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API

What specific section or headline is this issue about?

"Examples", specifically Dragging and dropping files

What information was incorrect, unhelpful, or incomplete?

The two examples which actually appear to be identical

Dragging and dropping files (Firefox only): https://jsfiddle.net/9C2EF/
Dragging and dropping files (All browsers): https://jsbin.com/hiqasek/

These both do not work in the latest version of Firefox on Ubuntu. I drag and drop a file, and the files array has length 0. So I get this:
image

In Chromium (hosted on localhost) the example has a file but the file size is 0!

File Count: 1
 File 0:
(object) : <[object File] > test1.txt 0

In Chromium on an incognito tab at the actual website https://jsbin.com/hiqasek/ I get

File Count: 0

What did you expect to see?

On both browsers the example should accept a file dragged onto the "DROP FILES HERE" div. The file should be readable. Otherwise, if this is an issue with browsers, I think the documentation should be updated to explain the limitations of this function.

(Also, second minor issue: there is a broken Interoperability anchor link in the blue Note section.)

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

This is using Ubuntu snap versions of Firefox and Chromium, updated to the latest version.

MDN metadata

Page report details
@mashdragon mashdragon added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Dec 31, 2024
@github-actions github-actions bot added the Content:WebAPI Web API docs label Dec 31, 2024
@mashdragon
Copy link
Author

I think I found why this is happening. Firefox won't accept dropped files from any temporary directory. It might be due to the snap sandboxing. I don't know.

@caugner
Copy link
Contributor

caugner commented Jan 3, 2025

Firefox won't accept dropped files from any temporary directory.

Yes, it's plausible that the snap versions of Firefox and Chromium don't have permissions to read from the temporary directory, and it's somewhat interesting if Firefox just ignores the file and Chromium treats the file like an empty file.

I'm not sure if it's worth documenting this, but I'll leave this to others to decide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.
Projects
None yet
Development

No branches or pull requests

2 participants