Modify tab restore queue to support tab restore on hover
Categories
(Firefox :: Session Restore, enhancement, P5)
Tracking
()
People
(Reporter: jswinarton, Unassigned)
References
(Blocks 1 open bug)
Details
This is an open proposal for potential changes that could fix bug 1879314 (a request to enhance tab hover preview by automatically restoring tabs and showing their screenshots in the tab card on hover after a session restore).
The basic solution for this involves calling gBrowser._insertBrowser()
on tab hover, which is listened to by SessionStore.sys.mjs
, eventually calling restoreTab
. However, for some reason, this alone is not enough to restore the tab correctly. For some reason it appears that the tab is being skipped in the TabRestoreQueue
. On insert, the tab is added to the visible
bucket of the queue, when the call is made to shift
the tab back out of the queue (called by restoreNextTab
), the tab is never restored.
This seems to be because there is a block within the shift
method that looks like this:
if (restorePinned && priority.length) {
set = priority;
} else if (!restoreOnDemand) {
if (visible.length) {
set = visible;
} else if (this.prefs.restoreHiddenTabs && hidden.length) {
set = hidden;
}
}
The else if (!restoreOnDemand)
check, which references the browser.sessionstore.restore_on_demand
check, appears to be saying that as long as that preference is set, no tabs in the visible
bucket will ever be restored.
Removing this check makes everything work as I expect for THP (see this WIP patch). However, I imagine this could have unintended consequences that I'm not aware of. I want to raise this here to discuss and see if this is in fact the right option, or if there is a better method that we can use to achieve the same result.
Comment 1•8 months ago
|
||
From our discussion in #session-restore, I don't think we're on the same page here; it doesn't seem clear that we want this at all, as opposed to e.g. just saving thumbnails from the last session. Marking as P5 until we have consensus here.
Description
•