thrust-cli 1.0.9 ā 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utils/daemon.js +5 -23
package/package.json
CHANGED
package/utils/daemon.js
CHANGED
|
@@ -151,7 +151,7 @@ export async function startDaemon(preferredPort) {
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
// ---
|
|
154
|
+
// --- TRULY UNIVERSAL BROWSER OPENER ---
|
|
155
155
|
async function safeOpenBrowser(url) {
|
|
156
156
|
try {
|
|
157
157
|
if (process.env.TERMUX_VERSION) {
|
|
@@ -161,28 +161,10 @@ async function safeOpenBrowser(url) {
|
|
|
161
161
|
} else if (!process.env.DISPLAY && process.platform === 'linux') {
|
|
162
162
|
console.log("š [Headless] Please open the URL manually in a browser.");
|
|
163
163
|
} else {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
try {
|
|
170
|
-
// ATTEMPT 1: Try Chrome App Mode
|
|
171
|
-
const browserProcess = await open(url, {
|
|
172
|
-
app: { name: chromeName, arguments: [`--app=${url}`, '--window-size=1000,800'] }
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
// Catch asynchronous spawn failures (e.g., Windows when Chrome isn't in PATH)
|
|
176
|
-
browserProcess.on('error', async () => {
|
|
177
|
-
console.log("š Chrome App Mode failed. Falling back to default browser...");
|
|
178
|
-
await open(url).catch(()=>{});
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
} catch (chromeErr) {
|
|
182
|
-
// Catch synchronous promise rejections (e.g., Mac/Linux when Chrome is missing)
|
|
183
|
-
console.log("š Chrome App Mode unavailable. Falling back to default browser...");
|
|
184
|
-
await open(url);
|
|
185
|
-
}
|
|
164
|
+
console.log("š Launching dashboard in your default browser...");
|
|
165
|
+
// By stripping the Chromium-specific '--app' flags and arguments,
|
|
166
|
+
// the OS will perfectly route this to Edge, Safari, Firefox, or Chrome.
|
|
167
|
+
await open(url);
|
|
186
168
|
}
|
|
187
169
|
} catch (e) {
|
|
188
170
|
console.log("\nš Please open the URL above manually.\n");
|