@bobfrankston/msgapidefs 0.1.34 → 0.1.36
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 +2 -0
- package/msgapi-plan.md +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -124,6 +124,8 @@ window.close(); // Instead of msgapi.close() if not passing result
|
|
|
124
124
|
| **Host Launcher Features** | | | | *Not part of `window.msgapi`; CLI / launcher-side* |
|
|
125
125
|
| Markdown rendering (`.md`/`.markdown` auto-render) | ✅ | ✅ | ❌ | Local `file://` URL → rendered HTML via `msgcommon/markdown` (marked + light/dark CSS). msga could match it in `MainPage.xaml.cs` URL interception — not done yet. |
|
|
126
126
|
| Unpacked Chrome extension loading (`-extension <dir>`) | ✅ | ❌ | ❌ | msgview-only via `session.extensions.loadExtension`. wry has no public extension API; WebKitGTK has none at all. msga would need a separate Android/WebView2 plumbing — not planned. |
|
|
127
|
+
| Headless mode (`-noshow` without `-save`) | ✅ | ✅ | ❌ | msger creates the WebView invisible (`with_visible(false)`) but still loads HTML and runs scripts — an embedded `<script>` can query the engine and `window.ipc.postMessage` a result back. Combined with `-result <fieldname>` for clean stdout, this lets msger act as a headless CSS/JS resolver (`contrast-color()`, `getComputedStyle()`, `CSS.supports()`). msgview matches with `BrowserWindow({show:false})` + `backgroundThrottling:false`. |
|
|
128
|
+
| Render to bitmap (`-render [file]`, `render` option) | ✅ | ✅ | ❌ | Headless page→image capture: the window is never shown; the page loads, settles (`renderDelay`, default 100ms after `load` + two rAFs), is screenshotted, and the host exits. `-render <file>` writes the image (format from extension: `.png`/`.jpg`/`.bmp`) and the JSON result carries `render: {path, width, height, format}`; bare `-render` (or API `render: true`) returns it as `render: {data (base64), width, height, format}`. Library API: `showMessageBox({render: "shot.png" \| true, renderDelay?, renderFormat?})`; a failed capture rejects (msger) or sets `renderError` in the result. Both hosts fall back to capturing whatever rendered if the page hasn't loaded within the timeout (default 30s in render mode). msger: WebView2 DevTools `Page.captureScreenshot` — **Windows only** for now; msgview: `webContents.capturePage()` — all Electron platforms. Width/height are physical pixels (include DPI scale). |
|
|
127
129
|
|
|
128
130
|
> **msger** now injects `window.msgapi` via `msger-api.js` with window control, UDP, and HTTP. File system and shell are not yet implemented in msger or msgview.
|
|
129
131
|
>
|
package/msgapi-plan.md
CHANGED
|
@@ -55,6 +55,8 @@ Shared planning document for msgapi across implementations:
|
|
|
55
55
|
| tcp.close() | ✅ | ✅ | ✅ | Close connection |
|
|
56
56
|
| **HTTP** |
|
|
57
57
|
| http.fetch() | ✅ | ✅ | ✅ | CORS/mixed-content bypass via native HTTP; returns real Response object |
|
|
58
|
+
| **Host Launcher (CLI / library, not `window.msgapi`)** |
|
|
59
|
+
| render to bitmap (`-render [file]` / `render` option) | ✅ | ✅ | ❌ | Headless page→image: hidden window, capture after load + `renderDelay` (100ms default), exit. File (.png/.jpg/.bmp by extension) or base64 object in `result.render`. msger: WebView2 CDP `Page.captureScreenshot`, Windows only; msgview: `webContents.capturePage()`, all platforms. 30s default timeout with best-effort capture fallback. Added 2026-07-03. |
|
|
58
60
|
| **Configuration** |
|
|
59
61
|
| setLogging(value?, name?) | ❌ | ❌ | ✅ | Returns old state; 'msga'/'msgapi'/'on'/'off'/null; name included in log messages/filenames |
|
|
60
62
|
| setAutoUpdate(value?) | ❌ | ❌ | ✅ | 'auto'/'check'/'off'; defaults to 'off' (web app owns policy) |
|