W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

Re: [Clipboard] checking if implementation allows reading/writing a given type to the OS clipboard

From: Paul Libbrecht <paul@hoplahup.net>
Date: Sat, 18 Feb 2012 13:48:52 +0100
Cc: public-webapps@w3.org
Message-Id: <32161ED4-1731-4675-8AAC-D13B752E7DBB@hoplahup.net>
To: Hallvord Reiar Michaelsen Steen <hallvord@opera.com>

Does this include an ability for a page to say that a media-type is supported?
(does it not appear natural?)


I won't brag about native type names. 
I still find they're good but they're really not well ruled so it's ok.

paul


Le 18 févr. 2012 à 01:16, Hallvord Reiar Michaelsen Steen a écrit :
> Having thought about this some more, I see that there is a fingerprinting concern if we tie this closely into the available applications/OS capabilities. Also I understand that the API would be relevant for drag and drop (thought I'm not quite sure how it would work). Hence I think the method should be on the DataTransfer.prototype object, and usable only inside event handlers:
> 
> if(event.clipboardData.isTypeSupported('foo/bar')) ...
> 
> "Supported" means: if you give me data labelled as this type, I know the OS description and (if applicable) the relevant meta data and formatting for this type, and can write it to the clipboard so that other native apps can make use of it. If data labelled with the OS's native name or constant for this type is on the clipboard, I can map it to the mime type and extract the data in a way the script can use. Additionally, if a blob of data in this format is dropped on my window, I'll know what to do about it, and if you drag this data *from* my window to another application on the system, I can format and label it in a way the targe app will understand."
> 
> 
> Paul Libbrecht wrote:
>   
>> I have one concern: media-types are likely to be insufficient
>> and "flavour names", whatever they are on the host platform
>> should be allowed I think. Almost arbitrary strings on Windows
>> and Uniform Type Identifiers on Mac should be allowed, I think.
> 
> No, I really don't think it is a good idea to make scripts on the web have to sniff the OS to determine what argument to pass to isTypeSupported().. If MIME types aren't sufficient, maybe we need to mint more MIME types as we go? :)
> 
> -- 
> Hallvord R. M. Steen
> Core tester, Opera Software
> 
> 
> 
> 
> 
> 
Received on Saturday, 18 February 2012 12:49:23 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:50 GMT