Fix: respect 'open in same tab' setting for feeds (#337)#338
Merged
Conversation
In MV3, the service worker can be terminated after inactivity, losing the in-memory feedTabId. Persist it to browser.storage.session (with fallback to local storage) so it survives service worker restarts. Also handle stale tab IDs gracefully by falling back to creating a new tab.
23b493d to
c3b1738
Compare
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
Fixes a bug where feeds could open in a new tab even when open in same tab is enabled.
Root cause
In Manifest V3, the background service worker can restart and lose in-memory state (
feedTabId), so the extension no longer knows which tab to reuse.Changes
feedTabIdin session storage (with local-storage fallback)Validation
npm run lint(passes)Closes #337