The web's clipboard, and how it stores data of different types
Posted by XLEX97@reddit | programming | View on Reddit | 8 comments
Posted by XLEX97@reddit | programming | View on Reddit | 8 comments
Unlikely_Hyena1345@reddit
I've been working on a super simple tool that I think many of you might find useful: Clipboard Online!
It's a free, no-login-required web-based clipboard for quickly moving text, links, or even images between any of your devices. Think of it as a temporary, universal copy/paste buffer that works across your phone, laptop, tablet – anything with a browser.
I built it out of my own frustration with constantly emailing myself notes or using clunky apps just to move a simple piece of text. Hopefully, it saves you some time too!
Check it out:https://clipboardonline.com/
Would love to hear your thoughts or any suggestions!
BundleOfJoysticks@reddit
1) cool article, I learned stuff!
2) ligatures are unreadable
ryantxr@reddit
I was under the impression that the clipboard was a function of the operating system. I had no idea that the web had a clipboard of its own. If I copy from vs code and paste into word, that uses the os clipboard. So how does the web clipboard come into play?
agentvenom1@reddit
The browser is reading and writing to the native OS clipboard. It's just that in the web, you're going through the browser's API's instead of the operating system's API's. The web API's would be understandably more locked down due to the nature of untrusted web applications.
In the article, the "The benefits of copy-pasting HTML" section and below go into all the nitty-gritty detail of how the browser API's map to actual OS clipboard contents.
Antique-Visual-4705@reddit
I think you’ve saved me countless hours reading and failing to discover this! Very timely, thank you!
guest271314@reddit
Nice article.
Technically you can write whatever you wantto the clipboard if you serialize the data first.
Spiritual-Matters@reddit
As a non-web dev I never even considered how copy & paste works in a webpage. Your article was well written!
XLEX97@reddit (OP)
Hey r/programming! I recently took the time to explore how the clipboard stores data of different types and found that the web clipboard had some really interesting limitations and inconsistencies.
This post was written up to share my learnings. I hope it's an interesting read!