Closed Bug 281012 Opened 20 years ago Closed 19 years ago

Closing the last tab loads an untitled page (about:blank) instead; doesn't clear session history

Categories

(Firefox :: Tabbed Browser, defect, P3)

2.0 Branch
defect

Tracking

()

RESOLVED FIXED
Firefox 2 beta1

People

(Reporter: toontownaholic24, Assigned: zeniko)

References

Details

(Keywords: fixed1.8.1, Whiteboard: SWAG: 0 (has patch))

Attachments

(1 file, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 When only one tab is open, and you have Firefox configured to show the tab bar, even when only one tab is open, when you close the tab by either middle-clicking it or clicking the close "X" button at the right of the tab bar, it closes the tab and spawns a tab entitled "(Untitled)" instead of closing the tab only. In other browsers, like Opera, it closes the tab to a blank window with no tabs. Reproducible: Always Steps to Reproduce: 1. Tools->Options->Advanced->Deselect "Hide the tab bar when only one tab is open" 2. Open one tab, and only one tab. 3. Middle click the tab. Actual Results: There is a tab named "(Untitled)." Expected Results: The software should have closed the tab and made a tabless browser window. Firefox should be configured to show the tab bar when only one tab is open.
See bug 156082. I don't think it's currently possible to have a tab bar without a tab (which would be the equivalent of a window without a content area). This is probably wontfix or invalid.
Why is it even possible to close the last tab open then? Shouldn't the X button be removed when there's only one tab open. Shouldn't the middle clicking the tab also be removed?
What's worse, when you do something that opens another tab, that same old blank tab remains, for no reason.
*** Bug 294261 has been marked as a duplicate of this bug. ***
Also the session history doesn't clear, which (I believe) is a symptom of not "properly" closing the last tab. This also has a tiny security implication: user is visiting xxx.porno.com, hears the boss/parent approach, closes the last tab knowing that the boss/parent doesn't understand History; unfortunately the boss/parent does understand Back; user fired/grounded.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: when you close the last tab open it opens an untitled page in a tab → Closing the last tab loads an untitled page (about:blank) instead; doesn't clear session history
Blocks: 303846
Good catch, Greg. Yes, applying the changes in bug 236721 comment 21 will fix this - I've been running with this now for a while, and it works great. Even better would be applying the changes in bug 236721 comments 20 and 21, which would fix both that problem and this one. I only wish that getting those fixes applied to the tree was as easy as creating the fixes in the first place - the current system (no feedback, no response) only discourages people like myself from fixing other things or from feeding our fixes back into the project.
Sorry for the bugspam, and a clarification on the above - by "fix this", I mean it will clear the session history. It'll still leave an about:blank tab though (i.e. those are two different issues). Personally, I don't think it should be possible to close this last tab (it should be possible to close the window of course, but the number of tabs should always be >= 1. Otherwise, if num tabs = 0, what's the point of even having the window open?)
*** Bug 315688 has been marked as a duplicate of this bug. ***
Nick's solution makes the current Firefox behaviour more consistent, i.e. closing the last tab should have the same effect as really closing it and opening a new one. Otherwise this is confusing for users (that still have a back button active after closign the tab), and for extensions like UndoCloseTab or TabFX that keep track of closed tabs history.
*** Bug 322101 has been marked as a duplicate of this bug. ***
I just voted for this bug since the one I reported, bug 322101, has been marked a duplicate of this one. However bug 322101 does *not* suggest that the tab bar should be removed as this bug does. bug 322101 says the tab bar should remain with an (Untitled) tab, a cleared session history, and a disabled Back button. It seems like the change asked for in bug 322101 is implemented in comment 7 made last August but hasn't been submitted yet.
+ for investigation along with the other inconsistencies around tab close.
Assignee: bugs → mconnor
No longer blocks: 303846
Severity: normal → minor
Status: NEW → ASSIGNED
Flags: blocking-firefox2+
Target Milestone: --- → Firefox 2 alpha2
Priority: -- → P3
Depends on: 236721
Whiteboard: SWAG: 0 (to be fixed by 236721)
The current patch to bug 236721 doesn't fix this issue anymore. And I'm not sure that just purging the tab's history is enough. People might then complain about the apparently "new" tab still retaining extension set attributes. Why not add a new tab while removing the one to be closed? This shouldn't be visible since the UI thread will be blocked until removeTab returns (at which point the new tab is displayed in lieu of the old one without flickering).
Attachment #220830 - Flags: review?(mconnor)
Do you need to adjust l after adding the new tab? if (this.mPrefs.getBoolPref("browser.tabs.autoHide")) { ... this.addTab("about:blank"); l = this.mTabContainer.childNodes.length; }
Thanks for catching that, logan. This patch additionally makes sure that we're not accidentally ending with one blank tab too many (should the content viewer not permit unloading).
Attachment #220830 - Attachment is obsolete: true
Attachment #220845 - Flags: review?(mconnor)
Attachment #220830 - Flags: review?(mconnor)
Comment on attachment 220845 [details] [diff] [review] replace the tab being closed with a new clean tab (take 2) this will go in later today
Attachment #220845 - Flags: review?(mconnor)
Attachment #220845 - Flags: review+
Attachment #220845 - Flags: approval-branch-1.8.1+
Target Milestone: Firefox 2 alpha2 → Firefox 2 beta1
Assignee: mconnor → zeniko
Status: ASSIGNED → NEW
Whiteboard: SWAG: 0 (to be fixed by 236721) → SWAG: 0 (has patch) [checkin needed]
mozilla/toolkit/content/widgets/tabbrowser.xml 1.152 mozilla/toolkit/content/widgets/tabbrowser.xml 1.103.2.44
Status: NEW → RESOLVED
Closed: 19 years ago
Keywords: fixed1.8.1
Hardware: PC → All
Resolution: --- → FIXED
Whiteboard: SWAG: 0 (has patch) [checkin needed] → SWAG: 0 (has patch)
Version: unspecified → 2.0 Branch
*** Bug 352917 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: