@bobfrankston/msger 0.1.197 → 0.1.199
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.
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/shower.d.ts
CHANGED
|
@@ -41,7 +41,8 @@ export interface MessageBoxOptions {
|
|
|
41
41
|
debug?: boolean; /** Return debug information (HTML, size) in result (default: false) */
|
|
42
42
|
showVersion?: boolean; /** Show version in window title (default: false) */
|
|
43
43
|
appUserModelId?: string; /** Windows AppUserModelID for taskbar pinning (internal use) */
|
|
44
|
-
initScript?: string; /** Custom JS injected into WebView alongside msger-api.js */
|
|
44
|
+
initScript?: string; /** Custom JS injected into WebView alongside msger-api.js (inline) */
|
|
45
|
+
initScriptPath?: string; /** Path to JS file injected into WebView (avoids large JSON) */
|
|
45
46
|
service?: boolean; /** Service mode: bidirectional IPC with parent. Stdin/stdout stay open. */
|
|
46
47
|
}
|
|
47
48
|
export interface MessageBoxResult {
|
package/shower.js
CHANGED
|
@@ -345,6 +345,16 @@ export function showService(options) {
|
|
|
345
345
|
rustOptions.height = rustOptions.size.height;
|
|
346
346
|
delete rustOptions.size;
|
|
347
347
|
}
|
|
348
|
-
|
|
348
|
+
// Convert local paths to file:// URLs (same as createMessageBoxHandle)
|
|
349
|
+
if (rustOptions.url && !rustOptions.url.startsWith("http://") && !rustOptions.url.startsWith("https://") && !rustOptions.url.startsWith("file://")) {
|
|
350
|
+
const absolutePath = path.resolve(rustOptions.url);
|
|
351
|
+
if (!fs.existsSync(absolutePath)) {
|
|
352
|
+
throw new Error(`File not found: ${absolutePath}`);
|
|
353
|
+
}
|
|
354
|
+
rustOptions.url = pathToFileURL(absolutePath).href;
|
|
355
|
+
}
|
|
356
|
+
const jsonToSend = JSON.stringify(rustOptions);
|
|
357
|
+
console.error(`[service] Sending to Rust: ${jsonToSend.slice(0, 200)}`);
|
|
358
|
+
child.stdin?.write(jsonToSend + "\n");
|
|
349
359
|
return new ServiceHandle(child);
|
|
350
360
|
}
|