

W3C Working Draft: Clipboard API and events - captn3m0
http://www.w3.org/TR/clipboard-apis/

======
pothibo
There's something that I really need to get off my chest and I looked for an
occasion to vent my frustration for a while. I'm taking this occasion right
now.

Instead of adding new APIs, is it possible to address the ENORMOUS elephant in
the house: <textarea>'s API.

It's unusable. People have built workarounds for _years_ and yet, nothing has
changed. Here's a few things to get started:

\- Autoresizing. CSS resize: auto; could work but I don't care how we do it.

\- Styling content. So we can use it to build IDE. So something like iA's
editor can be built.

\- Tokenizer. This would help solve the above. Could be a strip down version
of a HTMLElement. Or an approach like SVG. Anything. Lots of people have more
experience than me on this matter. I'm sure some of you can come up with
something.

\- Better input management. So we can build IDE with auto-indent.

The web is so dynamic now, and all the editor out there are ugly hacks that
are so hard to maintain. Anyone who's built an interface over
textarea/contentEditable shares my pain.

If, for whatever reason, it's impossible to have a textarea fullfill this job,
then can we at least get a decent contentEditable implementation. It's so
broken. On so many level.

I love you all, and I appreciate all the hard work, but I hate textarea's dumb
API.

~~~
LukeB_UK
There's no reason that this can't be addressed while adding new APIs. They're
not mutually exclusive.

------
conradk
Finally.

To me, this looks like a step further away from Flash (used for copying things
to the clipboard), which I see as a great thing.

Also, I've been working on a password manager that could dramatically benefit
from such an API. I hope that browser vendors will allow synthetic copy/paste
(especially copy) events if explicitly allowed by the user (similar to how
geolocation APIs work). This would be especially helpful for mobile devices
where it's difficult to copy things at the moment.

------
TimGremalm
This is nice, and could really be useful. But it's raising a lot of privacy
concerns. A lot of sensitive information is placed in the clipboard like
private URLs and even passwords sometimes.

I think a whitelisting of sites is needed in the web browser to use this API.

~~~
icebraining
They're aware of it: [http://www.w3.org/TR/clipboard-apis/#privacy-
concerns](http://www.w3.org/TR/clipboard-apis/#privacy-concerns)

------
TheCoreh
The problem I see with this spec (and the current implementation in browsers)
is that you can't trigger a copy without having the user manually press ⌘C or
do the platform equivalent command for that. That way you can't implement
custom UI (like toolbars) or even have a link automatically copied to
clipboard (by a URL shortener, or by a file upload website).

This is specially problematic on iOS and Android, where copy and paste depend
on contextual popups/bars that only show up when you have text selection. This
makes it much harder or impossible to implement advanced editors like say, a
3d modelling application, or image editor with copy and paste functionality on
these platforms.

------
Joe8Bit
The semantics of the "different" origin escaping will be interesting, in that
they talk about about rich text editing and the clipboard API's usefulness
there, but isn't removing the ability to copy/paste HTML 'formatted' text from
another origin a part of that use case?

------
Sven7
I am constantly switching between my phone and laptop/desktop. Quite often I
get a link on the phone that I would like to open on desktop or vice versa
(say forward a link on desktop to someone on whatsapp on my phone).

Would be nice to have some kind of "paste to device X"

~~~
kayone
Take a look at pushbullet, it allows you to share items between devices, they
also added a new feature which lets you share your clipboard between devices.

~~~
Sven7
Thanks! Looks useful

------
diafygi
I'm very curious to see if this will make it possible to have password
managers on Firefox OS.

