@bobfrankston/rmfmail 1.2.2 → 1.2.4

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
@@ -2700,22 +2700,24 @@ window.addEventListener("message", (e) => {
2700
2700
  return;
2701
2701
  }
2702
2702
  if (e.data?.type === "openLink" && e.data.url) {
2703
- window.open(e.data.url, "_blank", "noopener,noreferrer");
2703
+ const api = window.mailxapi;
2704
+ if (api?.openExternal)
2705
+ api.openExternal(e.data.url);
2706
+ else
2707
+ window.open(e.data.url, "_blank", "noopener,noreferrer");
2704
2708
  }
2705
2709
  if (e.data?.type === "linkClick" && e.data.url) {
2706
2710
  const url = e.data.url;
2707
- if (window.mailxapi?.platform === "android") {
2708
- // Android: use mailxapi:// bridge scheme OnNavigating intercepts it
2709
- // and opens in system browser. Raw http:// in sub-frames doesn't trigger OnNavigating.
2710
- const f = document.createElement("iframe");
2711
- f.style.display = "none";
2712
- f.src = `mailxapi://openurl?url=${encodeURIComponent(url)}`;
2713
- document.body.appendChild(f);
2714
- setTimeout(() => f.remove(), 500);
2715
- }
2716
- else {
2711
+ // Route through mailxapi.openExternal on desktop it spawns the OS
2712
+ // browser via the Node process (window.open stayed LOCAL inside msger's
2713
+ // WebView2 Bob 2026-06-13 "old bug back"); on Android it uses the
2714
+ // native intent bridge. Falls back to window.open only if the api isn't
2715
+ // present (bare browser / --server mode).
2716
+ const api = window.mailxapi;
2717
+ if (api?.openExternal)
2718
+ api.openExternal(url);
2719
+ else
2717
2720
  window.open(url, "_blank", "noopener,noreferrer");
2718
- }
2719
2721
  }
2720
2722
  if (e.data?.type === "previewToggleFullscreen") {
2721
2723
  toggleFullscreenPreview();