On Tue, 17 May 2011 15:50:30 +0900, Paul Libbrecht <p...@hoplahup.net>
wrote:
you seem to have not included João Eiras' answer:
Seems I overlooked that indeed. I thought something similar but didn't
include this, so it's good that João brought it up.
Le 5 mai 2011 à 04:34, João Eiras a écrit :
A synchronous XHR solves this use case and there are no magic locks.
But, couldn't a better solution, not involving locks, be a variation of
what you suggest:?
event.clipboardData.pushDataFromRequest(flavour, xhr)
This is actually quite nice, IMO. It avoids imposing limitations on the
HTTP traffic the way my first suggestion did. Either the script (by
listening to readystatechange events) or the UA can show some progress
indication. We also get all the same-origin security limitations and CORS
(in CORS-supporting UAs) for free.
The main downside I see, is that if the request takes more than a couple
of seconds to complete, the user might meanwhile have copied something
that will get overwritten in an unexpected way.
Practically, the other downside is that since we re-use HTML5's
DataTransfer for clipboardData, this will have to be defined in the HTML
spec - since it's a new feature I guess that at this point means it will
go into HTML6, so we won't see it for a while. I think Ian Hickson keeps
track of such feature requests but I'm not entirely sure how to get it
onto his list.
I'm surprised to be the only one pushing this considering the huge
wealth of desktop-like services. Use cases such as copy-a-pdf-fragment
from Google Docs Drawing, generate a complex ICS, or produce a good
raster image from a graph-display...
It often seems a bit random what ideas pop up during a standardisation
process.. :-)
--
Hallvord R. M. Steen, Core Tester, Opera Software
http://www.opera.com http://my.opera.com/hallvors/