fix(extension): revert #377 and cleanly fix same-url navigation timeout#380
Merged
fix(extension): revert #377 and cleanly fix same-url navigation timeout#380
Conversation
This reverts commit b7ada0e.
- Add normalizeUrlForComparison for minimal URL canonicalization (root slash + default port only; preserves hash and non-root paths) - Fast-path: skip navigation when tab is already at the target URL - Rewrite wait logic with finish() pattern to prevent double-resolve - Handle both same-URL and redirect scenarios in navigation listener - Add regression tests for same-URL and hash-route distinction
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
dist/background.js)What changed
normalizeUrlForComparison: Minimal URL canonicalization — only root slash (/→"") and default port. Preserves hash routes and non-root trailing slashes to avoid false matches.finish()pattern to prevent double-resolve; handles both same-URL navigations AND redirects (resolves when URL matches target OR URL changed from before).Differences from #377
dist/background.jsfinish()with settled flagValidation
cd extension && npx tsc --noEmit✅npx vitest run --root extension src/background.test.ts✅ (5 tests)npm test✅ (231 tests)cd extension && npm run build✅Note
extension/dist/background.jsis intentionally excluded from this PR to keep the diff clean. It should be rebuilt separately (e.g.cd extension && npm run build).