W3C home > Mailing lists > Public > public-webapi@w3.org > March 2006

Re: passive Copy-and-Paste with scripts

From: Paul Libbrecht <paul@activemath.org>
Date: Mon, 27 Mar 2006 22:36:38 +0200
Message-ID: <44284CD6.3010204@activemath.org>
To: Martijn <martijn.martijn@gmail.com>
Cc: Web APIs WG <public-webapi@w3.org>

Martijn wrote:
> I think you mean 'onselect' instead of 'onselected', right. 
Well that one is taken in MSIE and has a much different semantic... hence...
> With 'onselected' I get the feeling the selection already happened, so
> there is no way to cancel it.
>   
Well, indeed, this is the intent!
> You want to have an event raised when a clipboard action takes place?
> I mean you don't want it to happen when something is dragdropped (and
> copied at the same time)?
>   
Supposedly drag-and-dopped follows the same pattern.
The transfer and negotiation mechanisms certainly share a lot.
> I think you would also need a oncut.
>   
Good point, changed!
> Maybe it should be called onclipboard which happens when anything from
> the website is cut/copied on the clipboard?
> But maybe the separate events are needed.
> Anyway, microsoft already seems to have implemented it in some way:
> http://msdn.microsoft.com/workshop/author/dhtml/reference/events/oncopy.asp
> http://msdn.microsoft.com/workshop/author/dhtml/reference/events/oncut.asp
> http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onselect.asp
>   
MicroSoft Internet Explorer does it wrong, just as Java: it does offer 
direct access to the clipboard by the ability to write directly to the 
clipboard singleton... that is wrong for security reasons and has hailed 
the very many people to avoid copy-and-paste in scripts. Mozilla only 
offers it to specially trusted pages which shows well the mistrust....
You don't want  a web-page to garble, read, or write, your clipboard... 
you only want this *when you wish it* i.e. when standard gestures are 
taken.  Java doesn't allow access to the clipboard in applets either.
> It seems to me to be more logical to have the oncut and oncopy event
> handlers on the selection object, than on any element.
>   
What would be the selection object ? Something floating in the 
document's space ?
Looks like something that could be useful for use...

paul
Received on Monday, 27 March 2006 20:36:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:54 GMT