@bobfrankston/msger 0.1.382 → 0.1.383

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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/msger",
3
- "version": "0.1.382",
3
+ "version": "0.1.383",
4
4
  "description": "Fast, lightweight, cross-platform message box - Rust-powered alternative to msgview",
5
5
  "type": "module",
6
6
  "main": "./index.js",
package/shower.js CHANGED
@@ -458,8 +458,10 @@ function createMessageBoxHandle(options) {
458
458
  delete optionsToSend.message;
459
459
  }
460
460
  }
461
- // Convert URL to absolute file:// URL if it's a file path
462
- if (optionsToSend.url && !optionsToSend.url.startsWith('http://') && !optionsToSend.url.startsWith('https://') && !optionsToSend.url.startsWith('file://')) {
461
+ // Convert URL to absolute file:// URL if it's a file path. Skip
462
+ // when contentDir is set the URL is meant for the custom
463
+ // protocol, not file://.
464
+ if (optionsToSend.url && !optionsToSend.contentDir && !optionsToSend.url.startsWith('http://') && !optionsToSend.url.startsWith('https://') && !optionsToSend.url.startsWith('file://') && !optionsToSend.url.startsWith('msger://')) {
463
465
  // It's a file path, convert to absolute file:// URL
464
466
  // Resolve to absolute path (handles both / and \ separators)
465
467
  const absolutePath = path.resolve(optionsToSend.url);
@@ -474,6 +476,11 @@ function createMessageBoxHandle(options) {
474
476
  // Debug logging (uncomment if needed)
475
477
  // console.error(`[DEBUG] Path conversion: ${optionsToSend.url} → ${absolutePath} → ${fileUrl}`);
476
478
  }
479
+ // Resolve contentDir to absolute path so the Rust custom-protocol
480
+ // handler doesn't have to guess what cwd was at spawn time.
481
+ if (optionsToSend.contentDir) {
482
+ optionsToSend.contentDir = path.resolve(optionsToSend.contentDir);
483
+ }
477
484
  // Append hash to URL if specified
478
485
  if (optionsToSend.hash && optionsToSend.url) {
479
486
  // Strip any existing hash from the base URL