Skip to content

Commit 1ca8be4

Browse files
ralyodioclaude
andcommitted
desktop: revert extension key (restores lost settings) + feed-on-startup via pref
v0.2.12 added a manifest "key" to pin the extension id, which CHANGED the id — chrome.storage is keyed by id, so feeds/settings/keys got orphaned. Remove the key: the id reverts to the original path-derived one and the existing data comes back (it was never deleted). For feed-on-startup, don't force a URL (chrome://newtab/ = default NTP, chrome-extension:// = blocked from the command line). Instead seed session.restore_on_startup=5 ("Open the New Tab page") once per profile, which opens the NTP via the new-tab path that honors the chrome_url_overrides feed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 12c90f9 commit 1ca8be4

4 files changed

Lines changed: 31 additions & 28 deletions

File tree

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "TronBrowser",
4-
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtiZowpoE0HPpGEHjHLb1jsfa/G49HQGizDxZDbUbuIle96BxBD0KWZ54u1bMFgHi3RxYrmmMmhvvRfV3z6FSfTDlZjB7ydrkcrx4wFXLp9gWd/ec3VuNFy+qgob9Hmn77AH7NV58tf3G2u92vi3FA0b+Jte9+ZzuhabX5sseJY5IPvgL1ZdIALTVqb6dGdEz6O/yaID7BOusDbmewgDY2jANDZtiazL48oWiARM0TRNAvtvl3nWIK4dIVHnYOXdyGixKSr1lc/e8HkSoGkLp5O9zP9DT0DYPwSg/EZjlfoC1NDlwVNgxX0tw2r6BIiiXrhaUFfdUap5Jm6k582z1ZQIDAQAB",
5-
"version": "0.2.12",
4+
"version": "0.2.13",
65
"description": "TronBrowser — privacy-first, AI-native. Branded new tab, private search, CoinPay login, and a bring-your-own-keys AI sidebar.",
76
"icons": {
87
"16": "icons/icon-16.png",

‎apps/desktop/launcher/tronbrowser‎

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,26 @@ PY
131131
mkdir -p "$DATA"; : > "$DATA/.tron-search-xprivo"
132132
fi
133133

134+
# Show the feed (ai-sidebar New Tab page) on startup. We can't pass a startup URL —
135+
# chrome://newtab/ opens Chromium's DEFAULT NTP and chrome-extension:// pages are
136+
# blocked from the command line — but restore_on_startup=5 ("Open the New Tab page")
137+
# goes through the new-tab path, which honors the chrome_url_overrides feed. Once
138+
# per profile, then respect the user's chrome://settings/onStartup choice.
139+
if command -v python3 >/dev/null 2>&1 && [ ! -f "$DATA/.tron-startup-ntp" ]; then
140+
TB_PREFS="$DATA/Default/Preferences" python3 - <<'PY' 2>/dev/null || true
141+
import json, os
142+
p = os.environ["TB_PREFS"]
143+
os.makedirs(os.path.dirname(p), exist_ok=True)
144+
try:
145+
d = json.load(open(p)) if os.path.exists(p) else {}
146+
except Exception:
147+
d = {}
148+
d.setdefault("session", {})["restore_on_startup"] = 5 # 5 = open the New Tab page
149+
json.dump(d, open(p, "w"))
150+
PY
151+
mkdir -p "$DATA"; : > "$DATA/.tron-startup-ntp"
152+
fi
153+
134154
# Auto-detection only ever selects Ungoogled Chromium / flatpak ungoogled / the
135155
# macOS Ungoogled cask (which installs as Chromium.app). The only way to reach a
136156
# non-ungoogled binary is an explicit TRONBROWSER_BROWSER override — warn there,
@@ -175,15 +195,6 @@ FLAGS="--user-data-dir=$DATA --class=TronBrowser --no-first-run --no-default-bro
175195
LOG="${TRONBROWSER_LOG:-$DATA/tron.log}"
176196
FLAGS="$FLAGS --log-level=2"
177197

178-
# On a fresh launch with no URL, open the TronBrowser feed (the ai-sidebar new-tab
179-
# page) instead of a blank/default page. chrome://newtab/ shows Chromium's DEFAULT
180-
# NTP from the command line — the chrome_url_overrides newtab only applies to
181-
# UI-created tabs — so open the extension's page directly. The ID is fixed by the
182-
# manifest "key" (blkabajacljkbmjnffffobbnoipcckah).
183-
if [ "$#" -eq 0 ]; then
184-
set -- "chrome-extension://blkabajacljkbmjnffffobbnoipcckah/newtab.html"
185-
fi
186-
187198
if [ -n "$MAC_APP" ]; then
188199
# macOS: launch the .app via LaunchServices (`open`). Running the inner binary
189200
# directly SIGABRTs, and `-n` gives a separate instance from any running

‎apps/desktop/src/launcher.test.ts‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { describe, it, expect } from 'vitest';
2-
import { resolveStartUrls, DEFAULT_START_URL } from './launcher.js';
2+
import { resolveStartUrls } from './launcher.js';
33

44
describe('resolveStartUrls', () => {
5-
it('opens the feed (new tab page) when no URLs are given', () => {
6-
expect(resolveStartUrls()).toEqual([DEFAULT_START_URL]);
7-
expect(resolveStartUrls([])).toEqual([DEFAULT_START_URL]);
5+
it('injects no URL on a bare launch (NTP feed comes from the startup pref)', () => {
6+
expect(resolveStartUrls()).toEqual([]);
7+
expect(resolveStartUrls([])).toEqual([]);
88
});
99

1010
it('respects explicit URLs when provided', () => {
@@ -14,8 +14,4 @@ describe('resolveStartUrls', () => {
1414
'https://b.com',
1515
]);
1616
});
17-
18-
it('defaults to the ai-sidebar new-tab feed (fixed extension id)', () => {
19-
expect(DEFAULT_START_URL).toBe('chrome-extension://blkabajacljkbmjnffffobbnoipcckah/newtab.html');
20-
});
2117
});

‎apps/desktop/src/launcher.ts‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,14 @@ export interface LaunchConfig extends LaunchOptions {
1616
}
1717

1818
/**
19-
* The page shown on a fresh launch when no URLs are given: the TronBrowser feed
20-
* (the ai-sidebar new-tab page). chrome://newtab/ from the command line shows
21-
* Chromium's DEFAULT NTP — the `chrome_url_overrides` newtab override only applies
22-
* to UI-created tabs — so we open the extension's page directly. The extension ID
23-
* is fixed by the manifest "key".
19+
* Resolves the URLs to open. No forced startup URL — a fresh launch opens the
20+
* New Tab page (the ai-sidebar feed) via the browser's startup preference, which
21+
* goes through the new-tab path that honors `chrome_url_overrides`. Navigating to
22+
* chrome://newtab/ or a chrome-extension:// page from the command line does NOT
23+
* (default NTP / blocked by Chromium), so we never inject one here.
2424
*/
25-
export const DEFAULT_START_URL = 'chrome-extension://blkabajacljkbmjnffffobbnoipcckah/newtab.html';
26-
27-
/** Resolves the URLs to open, defaulting to the feed when none are supplied. */
2825
export function resolveStartUrls(urls?: string[]): string[] {
29-
return urls && urls.length > 0 ? urls : [DEFAULT_START_URL];
26+
return urls && urls.length > 0 ? urls : [];
3027
}
3128

3229
/** Launches the browser process with privacy flags enforced. */

0 commit comments

Comments
 (0)