@bobfrankston/rmfmail 1.2.220 → 1.2.222

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/client/app.js CHANGED
@@ -1514,6 +1514,27 @@ function showComposeOverlay(title = "Compose") {
1514
1514
  document.body.appendChild(wrapper);
1515
1515
  return frame;
1516
1516
  }
1517
+ // Native context-menu commands land in the TOP frame: msger dispatches them
1518
+ // with CoreWebView2.ExecuteScript, which always runs against the top-level
1519
+ // document. But the in-window compose is an IFRAME, and the handler that owns
1520
+ // the semantics (__msgerContextCommand) is defined inside it — so every
1521
+ // right-click item in the in-window compose hit msger's `window.__msgerContext
1522
+ // Command && …` guard, found nothing, and silently did nothing. The items were
1523
+ // registered for this window in v1.2.155; the dispatcher never was. Forward to
1524
+ // the frontmost compose overlay (same origin, so reaching into it is legal).
1525
+ window.__msgerContextCommand = (id) => {
1526
+ const frames = [...document.querySelectorAll(".compose-overlay iframe")];
1527
+ // Frontmost = highest z-index on the wrapper; mousedown maintains it, so
1528
+ // the one the user just right-clicked is the one on top.
1529
+ const target = frames.sort((a, b) => {
1530
+ const z = (el) => Number(el.closest(".compose-overlay")?.style.zIndex || 0);
1531
+ return z(b) - z(a);
1532
+ })[0];
1533
+ try {
1534
+ target?.contentWindow?.__msgerContextCommand?.(id);
1535
+ }
1536
+ catch { /* frame torn down mid-click */ }
1537
+ };
1517
1538
  /** Drop a transparent full-viewport shield in front of every other element
1518
1539
  * so mousemove events stay in the document during a drag. Setting
1519
1540
  * pointer-events:none on the compose iframe alone wasn't enough — the