thrust-cli 1.0.8 ā 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 +7 -21
package/package.json
CHANGED
package/utils/daemon.js
CHANGED
|
@@ -151,34 +151,20 @@ 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) {
|
|
158
|
-
exec(`termux-open-url ${url}`, (
|
|
159
|
-
|
|
158
|
+
exec(`termux-open-url ${url}`, () => {
|
|
159
|
+
console.log("š Please open the URL manually in your mobile browser.");
|
|
160
160
|
});
|
|
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
|
-
console.log("š
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
process.platform === 'win32' ? 'chrome' : 'google-chrome';
|
|
169
|
-
|
|
170
|
-
await open(url, {
|
|
171
|
-
app: { name: chromeName, arguments: [`--app=${url}`, '--window-size=1000,800'] }
|
|
172
|
-
});
|
|
173
|
-
} catch (err) {
|
|
174
|
-
// If Chrome fails (e.g., Windows Server EC2 often doesn't have Chrome in path),
|
|
175
|
-
// just use the absolute default system opener.
|
|
176
|
-
try {
|
|
177
|
-
await open(url);
|
|
178
|
-
} catch (fallbackErr) {
|
|
179
|
-
console.log("\nš OS security prevented auto-launching the browser. Please open the URL above manually.\n");
|
|
180
|
-
}
|
|
181
|
-
}
|
|
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);
|
|
182
168
|
}
|
|
183
169
|
} catch (e) {
|
|
184
170
|
console.log("\nš Please open the URL above manually.\n");
|