xpra-html5
xpra-html5 copied to clipboard
v11 - pasting does not work correctly for non-plain text
When you copy text from a browser page into a buffer - it usually includes some kind of hidden formatting.
With v11 (I upgraded from v9.1), when you press Ctrl+V
such text is pasted in an Xpra Client application with all formatting HTML tags.
E.g., I copy the word Assignees
from the current issue page and paste it into any application in Xpra Client with Ctrl+V
and get not the word Assignees
but:
<span style="color: rgb(132, 141, 151); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 600; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(13, 17, 23); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">Assignees</span>
Caused by #273
Unlike most real operating systems, we have no way of knowing what mimetype the application receiving the keyboard data actually wants.
I don't think that we can set both text/html
and text/plain
either - but it's worth a try.
The short term fix will be to add a configuration option on the connect page.
We can set both text/html
and text/plain
by providing multiple ClipboardItem
s and the application can then choose what it wants to use.
This will only work for browsers that implement Clipboard.write
, so this would work for chrome but not Firefox < 128 or Safari, see https://github.com/Xpra-org/xpra-html5/issues/301#issuecomment-2109269862
So we should probably still allow the html5 client to specify the preferred format - and default to text/plain
?
This will require a server-side change too: https://github.com/Xpra-org/xpra/issues/4228
Now working again for text/plain
which is the default again.
This can be changed using the advanced options:
@totaam I'm on the latest version of xpra and I don't see this option. I assume it hasn't been released yet?
I will have to set the format to text/plain
by default. Could you please let me know how I can set this in xpra.conf
?
@heinosasshallik text/plain
will be the new default.
I had done it wrong: #316