multithreaded-download-manager icon indicating copy to clipboard operation
multithreaded-download-manager copied to clipboard

Firefox locks up if you move a tab while the SaveAs dialog pops up

Open FeedrBackr opened this issue 6 years ago • 4 comments

If you're moving the position of a tab (by dragging the tab on the tabbar) and the 'Save As' dialog happens to pop up, then the browser will lock up completely and the Firefox process(es) will need to be killed from the TaskManager.

Luckily, Firefox will usually restore the session accurately, including the SaveAs dialog and resuming any active download tasks in the AddOn.

FeedrBackr avatar Sep 24 '18 23:09 FeedrBackr

I think this is a browser bug, as Firefox 57+ extensions should not freeze the browser. What happens if this extension is disabled, and a tab is being moved while the built-in download dialog pops up?

On my Firefox 62.0.2 / Windows 10, this will cause some glitch in the tab bar and freeze some toolbar buttons, but many parts of the browser can still be operated, and Firefox can be closed normally by clicking "x".

jingyu9575 avatar Sep 25 '18 10:09 jingyu9575

(Windows 7, 64bit; Firefox 62.0.2)

With your extension disabled, the 'SaveAs' dialog (that asks for the saving location) shows up immediately after the initial small 'Opening' dialog (where you can choose between 'open with' or 'save as'), so before the file starts downloading. There's no time in-between both dialogs to start dragging a tab.

I've tried different filetypes, and setting a fixed downloadfolder in the Firefox options.

It could very well be a browser bug if they assumed that the user wouldn't have time to interact with the browser when the SaveAs dialog is shown. Perhaps you can force your extension to show the SaveAs dialog before the download starts?

(btw, it's a fantastic extension!)

FeedrBackr avatar Sep 26 '18 02:09 FeedrBackr

the 'SaveAs' dialog (that asks for the saving location)

Oh I thought it was about the download prompt dialog. I set the extension to always ask for the download location, and moved a tab until the saveAs dialog showed. It indeed locked Firefox and nothing can be clicked. Switching to Firefox on the taskbar and pressing Esc can unlock it, so I think it is about mishandling of the mouse events.

If I am moving a tab while the download prompt dialog shows (e.g. by using a delayed download link), Firefox will only have some visual glitch and several buttons cannot be clicked. Moving that tab again can fix it.

I think these two problems are related and should be reported to Firefox. The first one which you reported is more serious, as it locks the entire browser and the way to unlock is not obvious. However I have not found out how to trigger it without extensions. I think using extensions may complicate the investigation of the bug and create more work for Firefox developers. I'll try to find ways to trigger saveAs dialogs without extensions, and see how to report the bug.


force your extension to show the SaveAs dialog before the download starts

Currently, this can not be implemented because of Firefox 57+ extensions' limitations. For Firefox 57+ extensions, the only way to save files is to call the built-in download manager, which has only two options for the saving location: the default download folder, and showing the saveAs dialog for users to choose. The problem is the built-in download manager only accepts URLs or complete data as the download source. Therefore, the extension has to retrieve the complete content first, and call the built-in download manager to show the saveAs dialog later.

This Firefox feature request is about allowing extensions to save files in a specified folder, which may solve the problem. The request is approved but there is no activity since 5 months ago.

jingyu9575 avatar Sep 27 '18 16:09 jingyu9575

I have found a way to reproduce this without extensions, and reported it to Firefox: Bug 1496107.

It seems that this is related to an (fixed) ancient bug:

Bug 100180: UI freezes if alert/dialog comes up while dragging (Modal dialog during drag causes hang)

It is first reported in 2001 and is fixed in 2014, and there are 64 other duplicate reports.

The minor glitch I experienced is reported in Bug 958635 in 2014, which is unresolved with no recent activity.

jingyu9575 avatar Oct 03 '18 15:10 jingyu9575