Closed Bug 1162036 Opened 5 years ago Closed 5 years ago

onPurgeSessionHistory() empties pending tabs and then just leaves them there

Categories

(Firefox :: Session Restore, defect)

defect
Not set
Points:
2

Tracking

()

VERIFIED FIXED
Firefox 40
Iteration:
40.3 - 11 May
Tracking Status
firefox40 --- verified

People

(Reporter: ttaubert, Assigned: ttaubert)

References

Details

Attachments

(1 file)

Currently, sanitizing browser history makes sessionstore throw away most of its state and recollect it. Pending/restoring tabs however are simply "cleared", they keep their icon and title but if you switch to them you just see "about:blank" and nothing happens. Looks like I also broke that functionality with the TabStateCache as quitting the browser in that state brings back all these emptied tabs.

Instead of leaving empty tabs around, that even confuse users due to them still having the same title and favicon, we should simply remove them. That resembles a lot better what actually happens and fixes the TabStateCache problem too.
Assignee: nobody → ttaubert
Status: NEW → ASSIGNED
Iteration: --- → 40.3 - 11 May
Points: --- → 2
Flags: qe-verify+
Flags: firefox-backlog+
Comment on attachment 8602101 [details] [diff] [review]
0001-Bug-1162036-Remove-pending-restoring-tabs-when-recei.patch

Review of attachment 8602101 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/components/sessionstore/SessionStore.jsm
@@ +1260,5 @@
>      this._forEachBrowserWindow(function(aWindow) {
> +      let tabs = aWindow.gBrowser.tabs;
> +      // Remove pending or restoring tabs instead of just emptying them.
> +      for (let i = tabs.length - 1; i >= 0; i--) {
> +        if (tabs[i].linkedBrowser.__SS_restoreState) {

Note to self: We'll need to get rid of __SS_restoreState one of these days.
Attachment #8602101 - Flags: review?(dteller) → review+
(In reply to David Rajchenbach-Teller [:Yoric] (use "needinfo") from comment #2)
> Note to self: We'll need to get rid of __SS_restoreState one of these days.

Indeed. Thanks!
Pushed again with a small fix so that we don't try to remove the last tab of a window when purging shistory.
https://hg.mozilla.org/mozilla-central/rev/d1431d237095
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 40
QA Contact: cornel.ionce
Depends on: 1163700
Verified as fixed on Windows 7 64-bit, Mac OS X 10.9.5 and Ubuntu 14.04 32-bit using:
- latest Nightly, build ID: 20150617030205.
- latest Aurora, build ID: 20150617004006.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.