You are not logged in.

#1 2018-03-16 01:21:18

drmoose
Member
Registered: 2018-03-15
Posts: 3

Trying to drag files into Firefox causes several seconds of lag

Dragging files into Firefox (into webpages that have "Drop Files Here" javascript) from any file manager on my Arch system, carries with it a roughly 1/2 sec per file lag spike, such that Firefox will not send the javascript dragover event, nor react to the files in any way, unless I pause mid-drag over my drag & drop destination. In other words, if I try to drag 10 files from Nemo to Firefox, I have to hold the mouse button, with the pointer over Firefox, for about five seconds before Firefox reacts to the files I'm trying to drag in.

On Cinnamon, when Firefox does finally "see" the files, the mouse pointer changes to the arrow-and-plus combination you get when dragging files across a file manager window.

Reproducing

I've been reproducing the issue using this simple HTML file and any ten random files I happen to have. Mime types and file sizes seem to be irrelevant; only the count matters.

<!DOCTYPE html>
<html>
  <body id=body>
    Hello World
    <script type="text/javascript" language="javascript"><!--
      var body = document.getElementById('body');
      window.addEventListener('dragover', function(evt) {
        body.style.backgroundColor = 'red';
      });
      window.addEventListener('dragleave', function(evt) {
        body.style.backgroundColor = 'white';
      });
      //-->
    </script>
  </body>
</html>
  1. Save the above code as test.html

  2. Open in firefox

  3. Open a file explorer and select ten files

  4. Drag the selected files into the firefox window, but do not drop them. The firefox window background will change to red.

  5. Cancel the drag

On Xenial and macOs, the background color changes instantly. On Arch, there's a good 3-5 seconds of delay before anything changes.

Due Dilligence
  • pacman -Syyuu on a freshly-updated mirrorlist doesn't find anything to do

  • I have rebooted

  • Nothing in pacman -Qm has anything to do with x11, dbus, or firefox (except when I was testing on nightly below)

  • No relevant pacnew files in /etc

  • While reproducing the issue, none of the following have anything relevant in them:

    • Firefox's stdout/stderr

    • dmesg -Hw

    • journalctl -xf

    • tail -f /var/log/**/*.log

    • top (cinnamon, nemo and firefox use about 10% cpu each; nothing is pegging the CPU)

    • Browser console, web console, or the browser profiler

Variables Eliminated
  • Hardware, Xorg driver: Reproduces on my desktop with nvidia-dkms and on my Intel-GPU laptop using the modesetting X11 driver

  • Fixed in future firefox: Reproduces both with the pacman firefox package and firefox-always-nightly from aur

  • Desktop environment: Reproduced on kde, cinnamon and fluxbox

  • Choice of File Explorer: Reproduced with dolphin, nemo and nautilus

  • Addons/about:config: Reproduces when firefox is started in a firejail --private

  • User account/home folder: Created clean user account

  • Size of the files: Reproduced on 10KB files and 100MB files; lag is roughtly the same (however, the number of files seems to be important)

Other OSes

Thinking this might just be a Firefox bug, I checked some other platforms.

  • Firefox on macOs doesn't do this.

  • On VirtualBox, Xenial and Artful both do it. However, a friend with Xenial on his laptop couldn't reproduce it.

Things I should know, but don't
  • When did it break? Some time in the last two months. I don't use the feature often enough to be able to definitively narrow down the specific -Syu that made it unusable

  • Has this been reported anywhere else? Not that I can find. There seem to be a couple of stack exchange posts with similar symptoms. The authors presume the fault is with their code, and never receive a satisfying response.

  • Does this happen on the firefox Wayland build? I've been putting off experimenting with Wayland until some of the currently-xorg-specific software I use has been ported.

Last edited by drmoose (2018-03-16 02:22:06)

Offline

#2 2021-01-23 02:03:41

sjy
Member
Registered: 2021-01-23
Posts: 1

Re: Trying to drag files into Firefox causes several seconds of lag

Thanks for posting this comprehensive report. I have been experiencing delayed file drag/drop events for months now as well, although I am using Firefox on Wayland (GNOME). Chrome works as expected. I don't have time to write a proper bug report, but I thought it was worth pointing out that at least one other person seems to have this problem in 2021.

Offline

Board footer

Powered by FluxBB