Cross-boundary communication between desktop and web
Source: Dev.to
Migrating a Desktop Product to SaaS – Preserving Inter‑Process Interactions
We have a desktop product that customers actively use, and we want to migrate toward a SaaS offering. In practice, that means we need backwards compatibility while we ship new features.
During that transition you often end up in a hybrid state: a desktop shell still exists, but more and more UI and logic moves into web technology (for example, hosted inside WebView2).
That hybrid state introduces a core challenge: how do you preserve everyday interactions across boundaries?
Drag & drop, keyboard copy/paste, focus, selection, and other “it just works” behaviours tend to break the moment parts of the UI live in different browsing contexts (iframes/windows) or even in a host process.
Demo
- Repo (reference implementation):
- Live demo:
Incremental Delivery via Explicit Boundaries
A pragmatic way to do incremental delivery is to introduce new modules behind explicit boundaries:
- Embed legacy / new pieces via iframe.
- Split experiences into separate windows when the host is desktop (or when multi‑monitor workflows help).
- Use Web Components to build reusable UI pieces without betting on a single framework.
The next question becomes: how do those pieces communicate so interactions (drag & drop, keyboard copy/paste) still work across boundaries? And how does it bridge to the desktop host?
Architecture Overview
+------------------------ Desktop host (WebView2) ------------------------+
| WebMessageReceived
- **WebView2 security**:
- **Frames in WebView2**:
- **Demo repository**: