Open jezell opened 2 months ago
I'm having similar challenges with even writing plaintext to the clipboard on the web. Is this common across all Formats on web?
@aardrop plain text should be safe to put in the clipboard on the web, assuming the site has been granted clipboard permissions by the user. Web generally allows text, html, and images without special hacks, but you can read more in the articles linked above about it.
Browsers won't let people add pdfs and almost anything but images + text to the clipboard by default, so the Chrome team came up with an idea called "web custom formats" to work around the issue. With web custom formats, apps can read and write any file type they want including internal data formats. These formats sometimes restrict things from working outside the browser, but at least they work within the browser.
https://developer.chrome.com/blog/web-custom-formats-for-the-async-clipboard-api
While it is possible to set these content types manually, it would be nice if it worked out of the box with things like
Formats.pdf
on web, and potentially if the other platforms also were updated to support "web " prefixes to allow pasting from web to other platforms:More details and very good explanation of the current state of Clipboard hacks and APIs on web: https://alexharri.com/blog/clipboard
Potentially fixes:
351