|
131 | 131 | mkdir -p "$DATA"; : > "$DATA/.tron-search-xprivo" |
132 | 132 | fi |
133 | 133 |
|
| 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 | + |
134 | 154 | # Auto-detection only ever selects Ungoogled Chromium / flatpak ungoogled / the |
135 | 155 | # macOS Ungoogled cask (which installs as Chromium.app). The only way to reach a |
136 | 156 | # 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 |
175 | 195 | LOG="${TRONBROWSER_LOG:-$DATA/tron.log}" |
176 | 196 | FLAGS="$FLAGS --log-level=2" |
177 | 197 |
|
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 | | - |
187 | 198 | if [ -n "$MAC_APP" ]; then |
188 | 199 | # macOS: launch the .app via LaunchServices (`open`). Running the inner binary |
189 | 200 | # directly SIGABRTs, and `-n` gives a separate instance from any running |
|
0 commit comments