Detect Tor Browser and route to .onion URLs (even on clearnet frontend)#160
Open
sh1ftred wants to merge 1 commit into
Open
Detect Tor Browser and route to .onion URLs (even on clearnet frontend)#160sh1ftred wants to merge 1 commit into
sh1ftred wants to merge 1 commit into
Conversation
- Updated utils/torUtils.ts to detect Tor Browser via navigator.userAgent - Added manual Tor mode preference with localStorage (getTorModePreference/setTorModePreference) - Modified isTorContext() to check in order: 1. Manual override from localStorage 2. .onion hostname check (existing behavior) 3. Tor Browser detection via user agent (new) Benefits: - Users accessing clearnet URL via Tor Browser now get routed to .onion provider endpoints - Users can manually override Tor mode via localStorage if needed - Maintains backward compatibility with existing .onion hostname detection Technical Details: - Tor Browser user agent contains 'tor' string - Added localStorage key 'routstr_tor_mode' for manual override - Auto-detects Tor Browser when no manual override is set Fixes #159
Deploying routstr-chat with
|
| Latest commit: |
d876b17
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ee7f9e40.routstr-chat.pages.dev |
| Branch Preview URL: | https://feature-tor-browser-detectio.routstr-chat.pages.dev |
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.
This PR enhances Tor support by detecting Tor Browser specifically, not just when the frontend is accessed via a .onion address.
Changes:
utils/torUtils.tsto detect Tor Browser vianavigator.userAgentgetTorModePreference/setTorModePreference)isTorContext()to check in order:Benefits:
Technical Details:
Testing:
Fixes #159