@bobfrankston/msger 0.1.410 → 0.1.411

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/README.md CHANGED
@@ -47,9 +47,10 @@ msger -html "<h1>Welcome!</h1><p>This is <strong>HTML</strong></p>"
47
47
  # Colored text with inline styles
48
48
  msger -html "<span style='color:red;background-color:yellow'>Alert!</span>"
49
49
 
50
- # Load a URL (web page or local file)
50
+ # Load a URL (web page, local file, or a directory's index.html)
51
51
  msger -url "https://example.com"
52
52
  msger -url "file:///path/to/page.html"
53
+ msger -url ./site # serves ./site/index.html and its sibling assets
53
54
 
54
55
  # Render a local markdown file — use the mdview wrapper (msger doesn't auto-render .md)
55
56
  mdview todo.md
@@ -307,7 +308,7 @@ Options:
307
308
  -message, --message <text> Plain text message
308
309
  -title, --title <text> Window title
309
310
  -html, --html <html> HTML content
310
- -url, --url <url> URL to load (web or file://)
311
+ -url, --url <url> URL to load (web, local file, or directory → its index.html)
311
312
  -hash, --hash <fragment> Hash fragment to append to URL (requires -url). Leading # optional.
312
313
  -buttons, --buttons <labels> Button labels (e.g., -buttons Yes No Cancel)
313
314
  -ok, --ok Add OK button
@@ -359,6 +360,13 @@ Notes:
359
360
  - OK button is green by default
360
361
  - URLs default to 1024x768 window size
361
362
  - Window title automatically updates from loaded page's <title> tag when using -url
363
+ - Local pages given to -url are served from their own directory over
364
+ http://msger.localhost/ rather than file:// (file:// pages cannot use the
365
+ msgapi IPC bridge at all — WebView2 aborts on them)
366
+ - Right-click → "Copy URL" copies the address of the current page; for local
367
+ content it copies the file's path on disk
368
+ - The loaded page's favicon becomes the window + taskbar icon (Windows);
369
+ pass -icon to keep your own icon instead
362
370
  - Windows auto-size to fit content when size not specified
363
371
  - Runtime zoom: Ctrl+Wheel, Ctrl+Plus, Ctrl+Minus
364
372
  ```
package/cli.js CHANGED
@@ -20,7 +20,8 @@ Options:
20
20
  -title <text> Set window title
21
21
  -html <html> Display HTML formatted message (inline)
22
22
  -htmlfrom <file|url> Fetch HTML from file/URL and embed in template (has buttons & msger API)
23
- -url <url> Load URL directly in webview (no template, no buttons)
23
+ -url <url|file|dir> Load URL directly in webview (no template, no buttons)
24
+ A local file or directory works too; a directory loads its index.html
24
25
  -hash <fragment> Hash fragment to append to URL (requires -url). Leading # optional.
25
26
  -buttons <label...> Specify button labels (e.g., -buttons Yes No Cancel)
26
27
  -ok Add OK button
@@ -72,6 +73,7 @@ Examples:
72
73
  msger -url "https://example.com"
73
74
  msger -url "https://example.com" -hash section1
74
75
  msger -url "https://example.com" -detach
76
+ msger -url ./site # local file or directory (directory → site/index.html)
75
77
  msger -title "Alert" -message "Operation complete"
76
78
  echo -e "\\x1b[31mError:\\x1b[0m Something failed" | msger
77
79
  echo '{"message":"Test","buttons":["OK"]}' | msger
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/msger",
3
- "version": "0.1.410",
3
+ "version": "0.1.411",
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
@@ -72,6 +72,30 @@ export function setAppName(name) { _appName = name; }
72
72
  * provision so Rust's window icon search picks it up. Per-call `icon` in
73
73
  * `MessageBoxOptions` still takes precedence. */
74
74
  export function setAppIcon(iconPath) { _appIcon = iconPath; }
75
+ /** Raspberry Pi: WebKitGTK's DMABUF rendering path is broken on the vc4/v3d
76
+ * driver — the page comes up as interlaced shredded scanlines instead of
77
+ * content (verified on a Pi 5 / Debian 13 / WebKitGTK 2.50.6 Wayland session,
78
+ * 2026-07-31). This is what "msger doesn't display properly on the Pi" was;
79
+ * setting WEBKIT_DISABLE_DMABUF_RENDERER=1 renders correctly. Scoped to the
80
+ * Pi because the DMABUF path is the faster one everywhere it works, and never
81
+ * applied when the caller has already set the variable (either way) so an
82
+ * explicit choice always wins. The Rust binary does the same for callers that
83
+ * bypass this launcher. */
84
+ function isRaspberryPi() {
85
+ if (platform() !== 'linux')
86
+ return false;
87
+ try {
88
+ return fs.readFileSync('/proc/device-tree/model', 'latin1').includes('Raspberry Pi');
89
+ }
90
+ catch {
91
+ return false;
92
+ }
93
+ }
94
+ function applyPiWebkitWorkaround(env) {
95
+ if (env.WEBKIT_DISABLE_DMABUF_RENDERER === undefined && isRaspberryPi()) {
96
+ env.WEBKIT_DISABLE_DMABUF_RENDERER = '1';
97
+ }
98
+ }
75
99
  function getUserBinDirFor(appName) {
76
100
  const isWindows = platform() === 'win32';
77
101
  if (isWindows) {
@@ -393,6 +417,7 @@ function createMessageBoxHandle(options) {
393
417
  if ('NODE_OPTIONS' in childEnv) {
394
418
  delete childEnv.NODE_OPTIONS;
395
419
  }
420
+ applyPiWebkitWorkaround(childEnv);
396
421
  // Spawn before constructing the Promise so `child` is guaranteed defined
397
422
  // by the time we hand it to MessageBoxHandle.
398
423
  const child = spawn(binaryPath, [], {
@@ -691,6 +716,7 @@ export function showService(options) {
691
716
  const childEnv = { ...process.env };
692
717
  if ("NODE_OPTIONS" in childEnv)
693
718
  delete childEnv.NODE_OPTIONS;
719
+ applyPiWebkitWorkaround(childEnv);
694
720
  const child = spawn(binaryPath, [], {
695
721
  stdio: ["pipe", "pipe", "pipe"],
696
722
  env: childEnv,