Skip to content

Commit 117f90e

Browse files
ralyodioclaude
andcommitted
feat(tor): default Tor OFF on launch + auto-enable on .onion (v3.2.11)
- Tor now defaults OFF on every fresh browser start (onStartup → disableTor). Removed the re-apply-on-wake that auto-resumed Tor after a restart — pointing at a daemon that isn't running yet, which also broke browsing. Within a session the proxy persists across SW restarts on its own. - Auto-enable Tor when navigating to a .onion host (webNavigation): start Tor, wait for the circuit, set the proxy, then reload the page now that it routes. Adds the webNavigation permission. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent d729b8e commit 117f90e

26 files changed

Lines changed: 55 additions & 34 deletions

File tree

apps/desktop/extensions/ai-sidebar/background.js

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,31 @@ chrome.runtime.onMessage.addListener((msg, _sender, sendResponse) => {
194194
}
195195
});
196196

197-
// Re-apply the proxy when the service worker wakes if Tor was left on (extension
198-
// proxy settings don't always survive a browser restart). Idempotent.
199-
(async () => {
200-
try {
201-
const { torEnabled } = await chrome.storage.local.get('torEnabled');
202-
if (torEnabled) await enableTor();
203-
} catch (_) { /* best effort */ }
204-
})();
197+
// Tor defaults OFF on every fresh browser start. Nobody should be routed through
198+
// Tor unless they ask — and the daemon isn't running yet at launch, so a
199+
// left-over proxy would just break browsing. (Within a session the proxy is a
200+
// persisted setting, so Tor stays on across service-worker restarts on its own.)
201+
chrome.runtime.onStartup.addListener(() => {
202+
disableTor().catch(() => {});
203+
});
204+
205+
// Auto-enable Tor when navigating to a .onion site — those only resolve through
206+
// Tor. Turn it on, wait for the circuit, then reload the page now that we route.
207+
chrome.webNavigation.onBeforeNavigate.addListener(async (details) => {
208+
if (details.frameId !== 0) return; // top-level navigations only
209+
let host;
210+
try { host = new URL(details.url).hostname; } catch (_) { return; }
211+
if (!host.endsWith('.onion')) return;
212+
213+
const { torEnabled } = await chrome.storage.local.get('torEnabled');
214+
if (torEnabled) return; // already routing through Tor
215+
216+
const started = await startTorViaHelper();
217+
if (started.error === 'unreachable' || started.error === 'tor-not-installed') return;
218+
const result = await waitForTor(() => {});
219+
if (result.ready) {
220+
await enableTor();
221+
// Re-issue the navigation now that traffic routes through Tor.
222+
try { await chrome.tabs.update(details.tabId, { url: details.url }); } catch (_) { /* tab gone */ }
223+
}
224+
});

apps/desktop/extensions/ai-sidebar/manifest.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "TronBrowser",
4-
"version": "3.2.10",
4+
"version": "3.2.11",
55
"description": "TronBrowser — privacy-first, AI-native. Branded new tab, private search, CoinPay login, and a bring-your-own-keys AI sidebar.",
66
"icons": {
77
"16": "icons/icon-16.png",
@@ -17,7 +17,8 @@
1717
"scripting",
1818
"identity",
1919
"proxy",
20-
"privacy"
20+
"privacy",
21+
"webNavigation"
2122
],
2223
"host_permissions": [
2324
"https://api.openai.com/*",

apps/desktop/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tronbrowser/desktop",
3-
"version": "3.2.10",
3+
"version": "3.2.11",
44
"private": true,
55
"description": "Desktop shell for the TronBrowser Chromium fork",
66
"type": "module",

apps/docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tronbrowser/docs",
3-
"version": "3.2.10",
3+
"version": "3.2.11",
44
"private": true,
55
"description": "Documentation site",
66
"type": "module",

apps/extensions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tronbrowser/extensions",
3-
"version": "3.2.10",
3+
"version": "3.2.11",
44
"private": true,
55
"description": "TronBrowser extension store — pay $1, list your MV3 extension (tronbrowser.dev/store)",
66
"type": "module",

apps/mobile/app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"slug": "tronbrowserdev",
55
"owner": "profullstack",
66
"scheme": "tronbrowser",
7-
"version": "3.2.10",
7+
"version": "3.2.11",
88
"orientation": "portrait",
99
"userInterfaceStyle": "dark",
1010
"platforms": [

apps/mobile/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tronbrowser/mobile",
3-
"version": "3.2.10",
3+
"version": "3.2.11",
44
"private": true,
55
"description": "TronBrowser mobile (Expo / React Native) — Phase 2",
66
"type": "module",

apps/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tronbrowser/web",
3-
"version": "3.2.10",
3+
"version": "3.2.11",
44
"private": true,
55
"description": "TronBrowser marketing site + web dashboard",
66
"type": "module",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tronbrowser",
3-
"version": "3.2.10",
3+
"version": "3.2.11",
44
"private": true,
55
"description": "TronBrowser.dev — open-source, privacy-first, AI-native browser",
66
"packageManager": "pnpm@9.12.0",

packages/agent-runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tronbrowser/agent-runtime",
3-
"version": "3.2.10",
3+
"version": "3.2.11",
44
"private": true,
55
"description": "Agent runtime: planner, executor, validator, memory, tools",
66
"type": "module",

0 commit comments

Comments
 (0)