Clipboard Synchronization
Thinfinity VirtualUI keeps the clipboard of the remote application in sync with the clipboard of the end user’s device. When the user copies content in the application, they can paste it locally — and the other way around.
Supported Formats
The clipboard travels in both directions with these formats.
| Content | Application format | Browser format |
|---|---|---|
| Plain text | CF_TEXT / CF_UNICODETEXT |
text/plain |
| Formatted text | HTML Format |
text/html |
| Rich text | CF_RTF |
RTF MIME types |
| Images | CF_BITMAP |
image/png (also accepts image/jpeg from the browser) |
When the user copies an image in the application, VirtualUI converts it to PNG before exposing it to the browser. When the user pastes an image from their device, VirtualUI decodes it and places a bitmap on the application’s clipboard.
Enabling and Disabling the Synchronization
Clipboard synchronization is enabled by default. You can turn it off from the ClientSettings object in the web page (app.js):
virtualUI.clientSettings.SynchronizeClipboard = false;
To keep the application’s clipboard strictly local — so the application never receives the content of the user’s device clipboard — enable the OPT_CLIPBOARD_LOCAL option in the SDK when starting VirtualUI.
Merging Browser Formats into the Application Clipboard
By default, when content arrives from the browser, VirtualUI first empties the application’s clipboard and then writes every synchronized format. The MergeClipboardFormats setting changes this behavior: it merges the incoming formats into the application’s clipboard without emptying it first, so content the application keeps in its own internal formats survives a paste from the browser.
Add it to thinfinity.params.ini in the Thinfinity VirtualUI binaries folder — bin32 or bin64, matching the application’s bitness — and restart the services:
[Options]
MergeClipboardFormats=text/plain,text/html
The value selects which browser formats are merged:
| Value | Behavior |
|---|---|
| (not set) | Original behavior: the application clipboard is emptied and all synchronized formats are written. |
all |
All formats received from the browser are merged, without emptying the application clipboard. |
Comma-separated MIME list (e.g. text/plain,text/html) |
Only the listed formats are merged, without emptying the application clipboard. |
When MergeClipboardFormats is set, it takes precedence over the passive clipboard mode: browser content is merged into the application clipboard even when PassiveClipboard=True. See Known Issues for the scenarios where passive mode applies.
Asynchronous Clipboard
For large content, the client can use the browser’s asynchronous clipboard interface. In this mode, VirtualUI shows a progress popup during the copy or paste operation until the transfer finishes.
Enable it from the web page:
virtualUI.clipboard.async = true;
You can also attach handlers to the clipboard events onCopy, onPaste, and onCut to customize the behavior.
The asynchronous clipboard relies on the browser’s Async Clipboard API. It requires an HTTPS connection and a user gesture, and image transfers are supported in Chromium-based browsers.