Re: Copy to Clipboard - ambush and abuse by javascript

Le 05-juin-10 à 20:34, Noah Mendelsohn a écrit :

> > Are browsers currently exposing the facility to put different  
> flavours

The facility for scripts does exist in HTML5 and MathML.

http://www.w3.org/TR/html5/editing.html#dnd

I believe this is the one that was used in tynt's scripts.
It is implemented in newer firefox and, I think newer safari.

MSIE always had a version of that, which,  I think was the original  
inspiration, it suffered security holes and changed behaviour along  
time.
Safari had another version since long, safer.

Note, however, that no browser will accept to export any format to the  
clipboard because of possible security concerns (pasted content enjoys  
considerable privileges). Generally, this ends up being html  
(sanitized), plain text, and URLs only.

> Yes. Just to pick one example, selecting some formatted text in  
> Firefox, and trying a Paste Special in MS Word on Windows offers:
>
> * Unformatted text
> * HTML Format
> * Unformatted Unicode text

Those are the browsers' choices, not the web-page choices.
Using ClipSpy or Clipboard Viewer is the right developer way to see  
all of the clipboard contents.

>> I think it's important that whatever rules we set for browsers not  
>> prohibit
>> such helpful re-expression of the same information using different  
>> formats.
>
> Two big 'customer' for a good spec here are namespaces and RDFa.

That would live in an ideal world we are far from: platforms, where  
the clipboards live, each have their own way of naming data flavours  
and, more importantly, of declaring them. Windows accepts any string  
(but seem to be uncomfortable with the usage of "-" in them), MacOSX  
now uses Universal type identifiers (a kind of reverse URIs writing  
way, with generalization relationship); both are declared by  
applications when they are first run or installed.

To date, I know zero official mapping from namespaces (be them XML or  
RDF) to such platform names; content format specification should name  
them I think.

I see no other way to let the namings be chosen by the web-page and  
let the, platform living, web-browser decide how to interprete these  
format names.

paul

Received on Monday, 7 June 2010 07:02:53 UTC