fix: restore recently closed tabs with navigation history#2373
Open
Draly wants to merge 1 commit into
Open
Conversation
Use browser.sessions.restore instead of Tabs.open when reopening tabs from the Recently closed tabs panel, so the restored tab preserves its full navigation history. Falls back to Tabs.open when the tab is no longer available in browser sessions.
Owner
|
Thanks. Currently there are some issues:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
browser.sessions.restore()instead ofTabs.open()when reopening tabs from the "Recently closed tabs" panel (trash icon), so the restored tab preserves its full navigation history (back/forward buttons work).Tabs.open()behavior when the tab is no longer available in browser sessions (e.g. older than 25 entries).Problem
Currently, clicking a tab in the "Recently closed tabs" sub-panel creates a brand new tab via
browser.tabs.create({ url }). This means the restored tab loses its entire navigation history -- the back button doesn't work, unlike Firefox's native "Recently closed tabs" (History menu) which usesbrowser.sessions.restore().Solution
Modified the
openTabs()function insub-panel.closed-tabs.vueto:browser.sessions.getRecentlyClosed()browser.sessions.restore(sessionId)(preserves history)Tabs.open()behaviorLimitations
browser.sessions.getRecentlyClosed()is limited to ~25 entries by default (browser.sessionstore.max_tabs_undo). Tabs beyond this limit will use the fallback.browser.sessions.restore()restores the tab at its original position; Sidebery's tab event handlers will then integrate it into the tree.Test plan