Bug 1757397

Summary: Cannot drag and drop image from Nautilus to Firefox
Product: [Fedora] Fedora Reporter: Gwendal <ezwen-redhatbugzilla>
Component: firefoxAssignee: Martin Stransky <stransky>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 31CC: 0xalen+redhat, anto.trande, gecko-bugs-nobody, jhorak, john.j5live, kengert, pjasicek, rhughes, rstrode, sandmann, stransky
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-08 10:28:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1054334    
Description Flags
video showing the problem
logs with MOZ_LOG="nsDragService:5"
logs with MOZ_LOG="nsDragService:5" when visiting pasteboard
simple D&D testcase none

Description Gwendal 2019-10-01 12:08:48 UTC
Created attachment 1621381 [details]
video showing the problem

Description of problem:

In some web pages, it should be possible to drag and drop pictures from the file explorer into an element of the web page (eg. adding an image to a Github issue).

Since I upgrade to Fedora 31, I cannot drag and drop an image from Nautilus to a Github issue opened in Firefox anymore.

Version-Release number of selected component (if applicable):
- firefox-69.0.1-3.fc31
- nautilus-3.34.0-1.fc31
- gnome-shell-3.34.0-3.fc31

How reproducible: always

Steps to Reproduce:
1. Open Firefox
2. Log into Github
3. In a Github project, open an issue
4. Drag and drop an image from Nautilus into the issue text editor

Actual results:

This text is pasted:

Expected results:

The image shoud be uploaded to Github and shown in the issue.

Comment 1 Gwendal 2019-10-01 12:11:56 UTC
Note: this work with Brave Browser (ie. chromium)

Comment 2 Martin Stransky 2019-10-01 12:12:22 UTC
Can you please try firefox-x11 if that works? Thanks.

Comment 3 Gwendal 2019-10-01 12:18:55 UTC
I just tried, and yes it works with firefox-x11!

Another information: it seems that it does not necessarily paste this text with drag and dropping :

but instead it seems to paste the current content of the clipboard − and probably the last thing I did was to put the image in the clipboard, before attempting to drag it

Comment 4 Martin Stransky 2019-10-01 14:17:18 UTC
I just tested that with https://pasteboard.co/ and it works for me *but* I had to create a new profile. It doesn't work with my current default profile I use. So can you try in safe mode and/or with a new ff profile? Maybe some extension is blocking it or so.

Comment 5 Gwendal 2019-10-01 14:40:39 UTC
I tried with a fresh firefox profile, and the problem remains :/


Comment 6 Martin Stransky 2019-10-02 07:22:25 UTC
Can you try upstream nightly binary under wayland? (see https://fedoraproject.org/wiki/How_to_debug_Firefox_problems?rd=Bug_info_Firefox#Testing_Mozilla_binaries)
If that fails, can you attach a log from D&D? Run ff as:

MOZ_LOG="nsDragService:5" ./firefox


Comment 7 Gwendal 2019-10-02 08:58:00 UTC
The problem still occurs with firefox nightly (firefox-71.0a1.en-US.linux-x86_64) running with wayland on a fresh profile. I started it with: 

    MOZ_ENABLE_WAYLAND=1  ./firefox -ProfileManager -no-remote

Then I started firefox nightly a second time on a fresh profile with the variable you gave like this: 

    MOZ_LOG="nsDragService:5" MOZ_ENABLE_WAYLAND=1  ./firefox -ProfileManager -no-remote

I went to a Github issue, tried to drag and drop an image in a comment, and then closed firefox. I'll attach the log right after this comment.

Comment 8 Gwendal 2019-10-02 08:59:25 UTC
Created attachment 1621771 [details]
logs with MOZ_LOG="nsDragService:5"

Comment 9 Martin Stransky 2019-10-02 11:35:11 UTC
Can you also please try https://pasteboard.co/ which I used for testing? It has an advantage that you don't need to log in to paste the image there.

Comment 10 Gwendal 2019-10-02 14:05:11 UTC
Created attachment 1621874 [details]
logs with MOZ_LOG="nsDragService:5"  when visiting pasteboard

Sure! Here you go.

Comment 11 Martin Stransky 2019-11-05 13:44:05 UTC
Gwendal, does the pasteboard.co work for you or not?

Comment 12 Martin Stransky 2019-11-05 13:45:29 UTC
Ah, I can reproduce the bug on Fedora 31 with pasteboard.co too.

Comment 13 Martin Stransky 2019-11-08 07:03:51 UTC
Strange, I can reproduce that with Fedora builds but it works with Mozilla binaries. Looks like a Fedora specific bug.

Comment 14 Martin Stransky 2019-11-08 07:13:20 UTC
Ahh, I see you can reproduce that with nightly too.

Comment 15 Martin Stransky 2019-11-08 12:58:33 UTC
Hm, I spend half of a day to poke this but without any result. I see the broken behavior with both X11 and Wayland Firefoxes, pasteboard.co works randomly.
But what I think interesting is a minimal tetscase located at https://www.w3schools.com/html/html5_draganddrop.asp
It seems to always work for me.

Gwendal, can you please try to test the testcase at https://www.w3schools.com/html/html5_draganddrop.asp ?
Launch the testcase by "Try it yourself" button and try to paste an image to a rectangle, it should show the image after that.


Comment 16 Gwendal 2019-11-08 14:47:10 UTC
It seems to work for me as well, but I think it is a different case than this bug, as it only manipulates elements inside the page, instead of receiving data dragged from the file explorer of the system?

Comment 17 Martin Stransky 2019-11-11 10:37:32 UTC
(In reply to Gwendal from comment #16)
> It seems to work for me as well, but I think it is a different case than
> this bug, as it only manipulates elements inside the page, instead of
> receiving data dragged from the file explorer of the system?

That testcase should also work when you drag a image from filemanager.

Comment 18 Martin Stransky 2019-11-11 12:02:56 UTC
There's a very simple testcase available - just drag image to firefox titlebar and it should open in a new tab. That works for me in 100% cases. I'm still investigating why the in-page JS code does not work.

Comment 19 Martin Stransky 2019-11-12 10:05:53 UTC
Created attachment 1635272 [details]
simple D&D testcase

Okay, I created this simple testcase - It works for me in Firefox and Chromium. Can you please test it? I suspect pasteboard and other may contain some JS bugs which break the D&D there.

Comment 20 Martin Stransky 2020-01-08 10:28:06 UTC
Please reopen if you can reproduce it with the testcase.

Comment 21 Gwendal 2020-01-08 10:37:05 UTC
Sorry for the delay! I made a few more tests with firefox-71.0-15.fc31:

- Drag and drop in Github now works for some reason! So it seems my initial problem was solved at some point.
- your simple test case works as well,
- but https://pasteboard.co/ still does not work though, strangely

Therefore I am fine with closing the issue seems it works in most cases, while previously it worked in zero cases (with my setup).

thanks for your investigation!

Comment 22 Gwendal 2020-01-17 06:31:29 UTC
(I add this comment to remove needinfo requests).