When firefox is exited by closing the last tab, that tab is restored on restart
Categories
(Firefox :: Session Restore, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox92 | --- | fixed |
People
(Reporter: vulcanb, Assigned: pyjacpp)
References
(Blocks 1 open bug)
Details
(Keywords: parity-chrome)
Attachments
(1 file)
Comment 1•16 years ago
|
||
Updated•16 years ago
|
Comment 3•16 years ago
|
||
Updated•15 years ago
|
Updated•15 years ago
|
Comment 5•14 years ago
|
||
Comment 7•14 years ago
|
||
Comment 8•14 years ago
|
||
Comment 9•14 years ago
|
||
Comment 10•12 years ago
|
||
Comment 11•12 years ago
|
||
Comment 12•6 years ago
|
||
It's 2019, and I still have this issue. :)
- Version
Firefox Quantum 67.0.4 (64-bit),
on NixOS 19.03 (VERSION="19.03.172979.8634c3b6199 (Koi)")
- Relevant options
browser.tabs.closeWindowWithLastTab: true (default)
browser.startup.page: 3 (modified)
- Steps to reproduce
A. Open Firefox
B. Navigate to https://bugzilla.mozilla.org/show_bug.cgi?id=490136
C. Close the tab with Ctrl-w
D. (Firefox exits)
E. Re-open Firefox
- Expected behavior
When I reopen Firefox, I expect to see my homepage (browser.startup.homepage)
- Actual behavior
When I reopen Firefox, I am taken to https://bugzilla.mozilla.org/show_bug.cgi?id=490136
Comment 13•6 years ago
|
||
By the way, the same problem exists if you replace step C with "Close the tab by clicking on the 'x' in the tab bar"
Comment 14•5 years ago
|
||
Still there in 73.0.1 (64-bit) on Ubuntu.
Updated•5 years ago
|
Comment 15•5 years ago
|
||
Per the reporter's STR, this feels more like a bug to me. In addition, this works correctly in Firefox macOS, likely because there is an explicit quit action which is somehow combined in other OSes.
Comment 16•5 years ago
|
||
(In reply to Asif Youssuff from comment #15)
Per the reporter's STR, this feels more like a bug to me. In addition, this works correctly in Firefox macOS, likely because there is an explicit quit action which is somehow combined in other OSes.
Thanks for the activity!
This bug affects me dozens of times per day.
I have gotten quite adept at pressing Escape to cancel loading whatever unwanted page pops up when I start Firefox.
I can explain the expected behavior in greater detail if it helps.
Comment 17•5 years ago
|
||
We confirm this issue on our forum https://forum.mozillaitalia.org/index.php?topic=74638.0
I tried to replicate the issue but as I have a pinned tab always I don't have that issue at all.
Comment 18•5 years ago
|
||
I just reproduced it in Nightly, the behavior still differs from Chrome where if you close the window the page is restored, but if you close the tab it's not.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 21•5 years ago
|
||
Thank Asif for closing some duplicate issues, including mine. I had no idea this had been an issue for 12 years already. I'm kind of amazed, because I run into this issue every time I close my last tab. It's not like "Restore previous session" is an obscure feature.
Comment 22•5 years ago
|
||
Hopefully it will now get some attention from the developers. I haven't personally worked with the code, but it seems likely to be a straightforward implementation.
There is obviously a function that runs when a tab is closed (I'll call it "closeTab") which removes it from the session, and another function that closes the window (e.g. "closeFF"). They obviously can run independently in the case of browser.tabs.closeWindowWithLastTab: false. So it seems that in the case of closeWindowWithLastTab: true, when the last tab is closed, all that would be needed to solve this is to run "closeTab" first (as if closeWindowWithLastTab is false), and then immediately run "closeFF".
Comment 23•5 years ago
|
||
osakawebbie, yes, it seems that it would be that simple to achieve the desired bahaviour already observed in Chrome.
It could be more complex than we expect, but it would appear that so far the biggest challenge has been to explain the issue to the developers.
Comment 25•4 years ago
|
||
I'd like to add that on Mac it works okay: when I close the last tab, it doesn't get restored on next startup.
But not on my PC and this is really frustrating.
Comment 26•4 years ago
|
||
Summary from my point of view
(Cross-platform FF user, Fedora/Ubuntu/../Windows, used to GNOME shortcuts)
Power-Users love keyboard shortcuts, but they need to be consistently over platforms, otherwise the user will curse you!
I'd like to reference https://developer.gnome.org/hig/stable/keyboard-input.html.en, although Linux Distros are no showcase either.
Ctrl+W
- closes current Tab (default for tabbed windows), similar to the X on the tab
- if it is the last tab, it should be up to the application to close the window or not
- having an application with multiple windows ( having open tabs), it is good to close the window with its last tab
- but for closing the last tab of the last window, my personal preference would be open a fresh new tab
Ctrl+F4
- seems to be equal to Ctrl+W, e.g. close document in MS Word, but I've never used that
Alt+F4
- similar to the X on a window
- especially Windows users would expect this to close a focused window, no matter of tabs
Ctrl+Q
- quit the application, including all windows
- more similar to File > Quit and 'Close all windows' on right click the application in the collapsed Windows taskbar
Ctrl+Shift+W
- should not be the same as Ctrl+Q, because the logical conclusion should be to close all tabs of a window
- regardless of the behavior on Ctrl+W for the last tab, I would expect that application is not terminated, otherwise I would have done Ctrl+Q
- pinned tabs should be excluded from closing
- currently it has the same behavior than quit and even with
browser.tabs.closeWindowWithLastTab: falseit closes the window
'Restore previous session' on startup is the uppermost setting and my personal default. I quit my day with Ctrl+Q or 'suspend hungry FF' if I need some more RAM for other applications. I just found Ctrl+Shift+D to bookmark all tabs of a window to a custom folder, which is btw. not documented here: https://support.mozilla.org/en-US/kb/keyboard-shortcuts-perform-firefox-tasks-quickly
I would love to see Ctrl+Shift+D and Ctrl+Shift+W as a local privacy preserving alternative to the OneTab AddOn, which has 100k users and about 100 reviews complaining about favicons generated with G.
Finally, the only way to bring up an explicitly closed tab should be explicitly restore it, e.g. with Ctrl+Shift+T. Even with the option 'Restore previous session', opening the browser should never bring up an explicitly closed tab nor it should open a session cleared with Ctrl+Shift+W.
Thank you!
| Assignee | ||
Comment 27•4 years ago
|
||
If one closes the last tab with the session restores enabled, it will re-open after restart.
Fix that by closing completely the tab before the stop of the browser.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 28•4 years ago
|
||
Will the fix for this issue affect bug 1321406 where restarting with only pinned tabs doesn't restore the final session but instead loads the Homepage?
| Assignee | ||
Comment 29•4 years ago
|
||
This issue doesn't affect bug 1321406. Because tabs are remaining, and the patch is only affecting when one closes all the remaining tabs.
Comment 30•4 years ago
|
||
Comment 31•4 years ago
|
||
| bugherder | ||
Comment 32•4 years ago
•
|
||
Backed out for causing bc failures in browser/components/sessionstore/test/browser_625016.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/4ea53a97727b6d1c6d35449b824ed5ad69fde344
Comment 33•4 years ago
|
||
| Assignee | ||
Updated•4 years ago
|
Comment 34•4 years ago
|
||
Comment 35•4 years ago
|
||
| bugherder | ||
Comment 36•4 years ago
|
||
Just ran into this issue again and wondered: "Would there be an update?"
Incredibly happy to see a fix is planned for the very next version! Can't wait. Dank je wel, Gijs!
Comment 37•4 years ago
|
||
This is not fully fixed. To still reproduce:
· open regular tab
· open private window
· close regular tab
· close private window
· start Firefox again
The regular tab will be back. Reopen or new report?
Comment 38•4 years ago
|
||
Hey, I'm glad this was fixed. :)
Unfortunately I am now experiencing a bug that seems related.
How to reproduce:
- Create a new empty directory as a new empty profile,
tmp_profile=$(mktemp -d) - Start firefox (use same profile for every following start):
firefox --profile $tmp_profile - Turn on session restoring in Settings.
- Open a few tabs.
- Close firefox and restart.
- (Tabs are restored, as expected)
- Close each tab individually with Ctrl+w, including the last tab
- Restart Firefox
- (No tabs are restored, as expected!)
- Open a few tabs.
- Close firefox and restart.
- Tabs are not restored! This is not expected.
I have found that I need to toggle the Session Restore setting in order to re-enable session restores. I'm not exactly sure what it takes, yet.
Comment 39•4 years ago
|
||
[b@bryan-laptop:~/tmp]$ firefox --version
Mozilla Firefox 92.0
Comment 40•4 years ago
|
||
I am unable to reproduce the behavior reported by Bryan in comment 38. Also on Firefox 92.0. Ubuntu with XFCE.
Bryan, this issue is closed. New problem reports need to be in new bug. Please recheck your steps to reproduce and click the "NewBug" link at the top of the page.
Comment 41•4 years ago
|
||
(In reply to B.J. Herbison from comment #40)
New problem reports need to be in new bug. Please recheck your steps to reproduce and click the "NewBug" link at the top of the page.
What about mine? Is that considered a case of this bug or a separate one?
Comment 42•4 years ago
|
||
(In reply to fabianroeling from comment #41)
(In reply to B.J. Herbison from comment #40)
New problem reports need to be in new bug. Please recheck your steps to reproduce and click the "NewBug" link at the top of the page.
What about mine? Is that considered a case of this bug or a separate one?
I can reproduce the case described in comment 37, with the clarification that the "regular tab" is the last tab in the non-private window when it is closed and it reappears.
While technically Firefox isn't exited by closing the regular tab it does seem like it could be a case of this bug. Should this bug be reopened or a new report created?
| Assignee | ||
Comment 43•4 years ago
|
||
Thank you for your report fabianroeling. I'm able to reproduce it
(In reply to B.J. Herbison from comment #42)
Should this bug be reopened or a new report created?
I don't know, I'm not an employee of Mozilla and I'm not too much experienced with bugzilla.
To me, in one hand, it could be reopened because it partially fixes the issue, but on the other hand, the bug only applies to private windows so in my opinion, we could create a new bug (please note that I'm not very experienced with these sorts of things).
I will try to get more information about what we should do.
In any case, if we decide to create a new bug about this new issue, could someone needinfo me or contact me so I could try to make a patch please?
| Assignee | ||
Comment 44•4 years ago
|
||
After discussing with Gijs, he said that I should fill a new bug, so I created bug 1732366 to track this issue.
Comment 45•4 years ago
|
||
(In reply to Antonin LOUBIERE from comment #44)
After discussing with Gijs, he said that I should fill a new bug, so I created bug 1732366 to track this issue.
Thanks Antonin! Yes, I think this is the right call. I've copied Fabian in on that issue.
(In reply to Bryan from comment #38)
Hey, I'm glad this was fixed. :)
Unfortunately I am now experiencing a bug that seems related.
How to reproduce:
<snip>
Bryan, if you're still seeing this, as noted in comment #40 it would be useful to file a separate bug with some more details (also e.g. whether you're using a distro build or an official build, and given that other people couldn't reproduce, perhaps a screencast could help with working out what we're doing differently?).
Comment 46•4 years ago
|
||
Hi Bryan, I think your observation in comment 38 has been filed in bug 1730021, which was reported by a Windows user. In my opinion, it deserves a higher priority due to unpredictable/invisible data loss.
For now, if you end a session by closing the last tab (Ctrl+w), and have Firefox set to restore your session, I suggest treating the initial window as fundamentally broken. Immediately create a new window for your new session and forget about that initial one.
Comment 47•3 years ago
|
||
Last tab is still restored if it was closed by window.close().
uBlock Origin (and maybe AdGuard) now have window-close-if scriptlet https://github.com/gorhill/uBlock/commit/c198b9a748265c0e1ce7f5bad4528d5bf6ce8161
which should be used to close tabs opened from other applications. It works by calling window.close() in page context, so it works only on fresh tabs.
If you add example.com##+js(window-close-if) to uBO "My filters", close all tabs (and browser), then use command line like this:
~/firefox-nightly/firefox -P "nightly-test" https://example.com/
there will not be possible to manually launch Firefox again, because it will restore example.com on each startup and this tab will be closed by add-on which in turn will close whole browser.
There is no issue in Chrome because on next manual start Chrome launches "New tab" - does not restore example.com.
Comment 48•3 years ago
|
||
(In reply to gwarser from comment #47)
Last tab is still restored if it was closed by
window.close().uBlock Origin (and maybe AdGuard) now have
window-close-ifscriptlet https://github.com/gorhill/uBlock/commit/c198b9a748265c0e1ce7f5bad4528d5bf6ce8161
which should be used to close tabs opened from other applications. It works by callingwindow.close()in page context, so it works only on fresh tabs.If you add
example.com##+js(window-close-if)to uBO "My filters", close all tabs (and browser), then use command line like this:~/firefox-nightly/firefox -P "nightly-test" https://example.com/there will not be possible to manually launch Firefox again, because it will restore
example.comon each startup and this tab will be closed by add-on which in turn will close whole browser.There is no issue in Chrome because on next manual start Chrome launches "New tab" - does not restore
example.com.
Hey,
That sounds like it's working as intended if tabs are set to be restored. Closing a window with one tab is different than closing the last tab on a window, if you get what I mean. Should the scriptlet be closing the tab instead?
Comment 49•3 years ago
|
||
(In reply to gwarser from comment #47)
Last tab is still restored if it was closed by
window.close().
Please file a new bug instead of commenting here.
Description
•