clipboard-apis icon indicating copy to clipboard operation
clipboard-apis copied to clipboard

RTF is not exposed when using navigator.clipboard.read()

Open vmiklos opened this issue 1 year ago • 0 comments

The typical common format between applications for copy&paste on the desktop used to be RTF for a long time.

Reading https://w3c.github.io/clipboard-apis/#reading-from-clipboard, only HTML is suggested for rich text, but many applications have either no support for HTML paste or their HTML paste support is worse then RTF paste, because it wasn't a frequent codepath in the past.

I understand that exposing RTF means one more format to sanitize, but in case PNG and HTML is already sanitized, then RTF could be also allowed + sanitized.

For example, with all its problems, the old document.execCommand('paste') API used to allow reading RTF, and not even after we get permission from the browser, this use-case is broken, the consuming javascript must handle HTML instead. This is a problem in larger existing web applications, like Collabora Online.

Could you please consider adding RTF to the format list at "6.4.1. Reading from the clipboard"? Thanks.

vmiklos avatar Jan 18 '24 08:01 vmiklos