Skip to content

Support SPA URL changes via chrome.webNavigation#34

Open
kokoichi206 wants to merge 2 commits intogeovanneb:masterfrom
kokoichi206:feature/spa-webnavigation-support
Open

Support SPA URL changes via chrome.webNavigation#34
kokoichi206 wants to merge 2 commits intogeovanneb:masterfrom
kokoichi206:feature/spa-webnavigation-support

Conversation

@kokoichi206
Copy link
Copy Markdown

Thank you for sharing this awesome Chrome extension!

Single-page apps often change the URL via history.pushState/replaceState only (for example the Supabase dashboard), so relying solely on hashchange left the environment ribbon stuck in the previous state.

The background script now listens to chrome.webNavigation.onHistoryStateUpdated, sends a urlChanged message, and the content script toggles the ribbon accordingly, so _addEnvironmentLabel reruns on those virtual SPA navigations as well.

Adding another permission is always sensitive, but here webNavigation is strictly used to detect History API transitions so the ribbon stays accurate.
Please let me know if this raises any policy concerns.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant