[upstream,regression] Firefox does not save tabs when quitting with Ctrl+Q

Bug #1948652 reported by Alexander
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Fix Released
Unknown
firefox (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

1) % lsb_release -rd
Description: Ubuntu 20.04.3 LTS
Release: 20.04

2) % apt-cache policy firefox
firefox:
  Установлен: 93.0+build1-0ubuntu0.20.04.1
  Кандидат: 93.0+build1-0ubuntu0.20.04.1
  Таблица версий:
 *** 93.0+build1-0ubuntu0.20.04.1 500
        500 http://ua.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
        100 /var/lib/dpkg/status
     75.0+build3-0ubuntu1 500
        500 http://ua.archive.ubuntu.com/ubuntu focal/main amd64 Packages

3) After start Firefox expected to restore previous session
4) Firefox start with new tab

If I close Firefox by Ctrl-Q with opened tabs and start it again Firefox opens with one new tab. When profile was recreated issue was gone but appeared again after Firefox was closed by Ctrl-W.
The option "Restore previous session" is on. Without extension behavior the same. I'm not sure but this begins after last update of Firefox

Revision history for this message
In , Gijskruitbosch+bugs (gijskruitbosch+bugs) wrote :

Created attachment 9237163
Spec for dialog

Right now, `browser.tabs.warnOnClose` governs a warning that appears when closing multiple tabs.

We'll want a separate pref, `browser.warnOnQuitShortcut`, that defaults to true on macOS and Linux, and false on Windows.

We'll want to check this pref when the user quits the browser using the `<key id="key_quitApplication">`.

Right now, the quit warnings hook into this BrowserGlue.jsm code: https://searchfox.org/mozilla-central/rev/12770bd668c0a6bdaa8eb96ad9507c6febe8d23d/browser/components/BrowserGlue.jsm#2779 .

For the telemetry work in an earlier bug (bug 1712306), we added `_quitSource` on the BrowserGlue object; we can check if it is `shortcut` to see if that was the case, and if so, show an appropriate warning prompt. If we show this prompt, we should not also show the "regular" quit / close-multiple tabs prompt, even if that would otherwise have been shown; there's no point confirming it twice!

We should be able to have the single `confirmEx` call for quitting use either the quit shortcut text and checkbox text, or the "multiple tabs" version and checkbox text (x-ref bug 1724964), depending on our reason for showing the warning.

To include the shortcut text in the text, we'll want to grab the `key` element in one of the open windows for the shortcut, and use `ShortcutUtils.prettifyShortcut` to get text for the shortcut, that we can then insert in the message we display.

Note that this shortcut warning applies even if there is only 1 tab (`pagecount == 1` in the BrowserGlue code, where it currently returns early if `pagecount < 2`).

Revision history for this message
In , Enn (enndeakin) wrote :

There are three existing preferences related to closing tabs/quitting:

browser.warnOnQuit - hidden preference that overrides all others if false
browser.sessionstore.warnOnQuit - hidden preference that disables warning on quit when session store is active
browser.tabs.warnOnClose - disables close tab warning, corresponds to checkbox in preferences

Is the intent here (and for the other related bugs) to remove the 'browser.sessionstore.warnOnQuit' preference and use 'browser.tabs.warnOnClose' for closing or quitting without the keyboard shortcut (close button or quit from the menu), and add a new preference 'browser.warnOnQuitShortcut' for quitting with Ctrl/Cmd+Q?

Will the new 'browser.warnOnQuitShortcut' preference have UI in preferences?

Revision history for this message
In , Gijskruitbosch+bugs (gijskruitbosch+bugs) wrote :

(In reply to Neil Deakin from comment #1)
> There are three existing preferences related to closing tabs/quitting:
>
> browser.warnOnQuit - hidden preference that overrides all others if false
> browser.sessionstore.warnOnQuit - hidden preference that disables warning on quit when session store is active
> browser.tabs.warnOnClose - disables close tab warning, corresponds to checkbox in preferences
>
> Is the intent here (and for the other related bugs) to remove the 'browser.sessionstore.warnOnQuit' preference and use 'browser.tabs.warnOnClose' for closing or quitting without the keyboard shortcut (close button or quit from the menu), and add a new preference 'browser.warnOnQuitShortcut' for quitting with Ctrl/Cmd+Q?

Yep, that's all correct. I think my assumption was that we could deal with the session store pref removal in bug 1724976.

> Will the new 'browser.warnOnQuitShortcut' preference have UI in preferences?

Yes. The authoritative spec is in figma; I'll add another screenshot for the preferences portion.

Revision history for this message
In , Gijskruitbosch+bugs (gijskruitbosch+bugs) wrote :

Created attachment 9238724
Preference update for the new shortcut-related warning

The expectation is that this warning only shows up on macOS+Linux, with the relevant shortcut embedded in the message.

Revision history for this message
In , Enn (enndeakin) wrote :

Created attachment 9238974
Bug 1726736, add a separate preference when quitting using the shortcut key, and modify the close dialog warning to indicate that the warning only applies to keyboard quitting, r=mhowell

Depends on D124221

Revision history for this message
In , Enn (enndeakin) wrote :

Created attachment 9238975
Bug 1726736, add checkbox to the main preferences page for the confirm on pressing the quit keyboard shortcut setting, r=mhowell

Depends on D124222

Revision history for this message
In , Enn (enndeakin) wrote :

Created attachment 9239948
Bug 1726736, test for quit keyboard shortcut opening confirmation dialog, r=mhowell

Depends on D124223

Revision history for this message
In , Pulsebot (pulsebot) wrote :

Pushed by <email address hidden>:
https://hg.mozilla.org/integration/autoland/rev/ded428a99b80
add a separate preference when quitting using the shortcut key, and modify the close dialog warning to indicate that the warning only applies to keyboard quitting, r=mhowell
https://hg.mozilla.org/integration/autoland/rev/d648841f25c8
add checkbox to the main preferences page for the confirm on pressing the quit keyboard shortcut setting, r=Gijs,fluent-reviewers,preferences-reviewers,flod
https://hg.mozilla.org/integration/autoland/rev/9f39ead09bf3
test for quit keyboard shortcut opening confirmation dialog, r=mhowell

Revision history for this message
In , Smolnar (smolnar) wrote :
Revision history for this message
In , Aryx-bugmail (aryx-bugmail) wrote :

Is it intended to have the dialog about closing multiple windows been shown if the (Windows) user uses menu File > Quit and has automatic session restore on launch enabled?

Revision history for this message
In , Enn (enndeakin) wrote :

The close multiple tabs/windows warning will appear if 'Confirm before closing multiple tabs' is checked in preferences when pressing the window close button or selecting quit/exit from the menu. The session restore setting no longer has any effect on whether this warning applies. All of this was done in bug 1724976 however. This bug is about the separate preference for the keyboard shortcut.

Revision history for this message
In , Enn (enndeakin) wrote :

*** Bug 1692205 has been marked as a duplicate of this bug. ***

Revision history for this message
Olivier Tilloy (osomon) wrote :

Ctrl+W will close the currently focused tab. If you have only one tab open, this tab will be closed and firefox will exit. It is therefore expected that at the next start, nothing will be restored. If you want your one tab to be restored at the next startup, use Ctrl+Q or Alt+F4 to close Firefox.

Or did you have more than one tab open?

Changed in firefox (Ubuntu):
status: New → Incomplete
Revision history for this message
Alexander (alexander-galato) wrote :

1) When open some tabs and quit Firefox by Ctrl+Q session doesn't restore
2) When delete profile (~/.mozilla) and recreate it, session restore but
3) When close last tab with Ctrl+w, run firefox, open some tabs, quit with Ctrl+Q and run again, session doesn't restore

Revision history for this message
In , Sergiu-negritas (sergiu-negritas) wrote :

Hello! I have managed to reproduce the issue with firefox 93.0a1(2021-08-20) on Windows 10. I can confirm that the issue is fixed with firefox 94.0b9 and 95.0a1(2021-10-24) on Windows 10, Ubuntu 20 and macOS 10.15.
I will update the flags and status of this issue.

Thank you!

Revision history for this message
Olivier Tilloy (osomon) wrote :

I can indeed observe this problem in a VM, following your instructions.

Changed in firefox (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Olivier Tilloy (osomon) wrote :

I just tested a 94.0 beta 10 build in the same VM, and the regression appears to be fixed there.

Revision history for this message
Olivier Tilloy (osomon) wrote :

This is probably related to https://bugzilla.mozilla.org/show_bug.cgi?id=1726736 (I couldn't find a bug describing exactly this regression).

Changed in firefox (Ubuntu):
status: Confirmed → Fix Committed
summary: - Firefox do not save tabs
+ [upstream,regression] Firefox does not save tabs when quitting with
+ Ctrl+Q
Changed in firefox:
status: Unknown → Fix Released
Olivier Tilloy (osomon)
Changed in firefox (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.