W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2015

Re: [clipops][editing] document.execCommand('copy', false, 'some data') ?

From: Hallvord Reiar Michaelsen Steen <hsteen@mozilla.com>
Date: Mon, 13 Apr 2015 14:18:54 +0200
Message-ID: <CAE3JC2z8ut_C4_dhC_ZXh6AA6j-0nQ5h6hV2zeWG9iH7-_S5XQ@mail.gmail.com>
To: Aryeh Gregor <ayg@aryeh.name>
Cc: WebApps WG <public-webapps@w3.org>
On Sat, Apr 11, 2015 at 8:16 PM, Aryeh Gregor <ayg@aryeh.name> wrote:

> > element.onclick = function(){
> >     document.execCommand('copy', false, 'foo');
> > }
>
> Is this really "copying"?


As in "an operation that places some data on the system clipboard", yes ;)
but I see your point of view.


> I think a new function for "set clipboard
> contents to specified value" would make more sense than overloading
> execCommand("copy") to mean something more than the standard
> text-editor meaning of "copy".  Besides, execCommand() is awful and we
> should prefer other APIs when possible.
>

So.. are you suggesting something like

window.Clipboard.setData('text/plain', 'foo') ?
-Hallvord
Received on Monday, 13 April 2015 12:19:25 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:31 UTC