Hacker News new | ask | show | jobs
by JoelBesada 5046 days ago
Pasting in Safari doesn't quite work, like you said the paste event requires a text box to trigger, and while it seems to have the same clipboard API as Chrome, images don't seem to show up there.

In Firefox a contenteditable div is used to catch pasted content, when images are pasted an img tag with base64 encoded image data is inserted, which is easy to just grab and display. Unfortunately, this doesn't work in Safari.

Because Safari seems to support all the needed APIs, it's hard to detect and inform the user that copy and paste doesn't work. I'd rather not do any browser sniffing.