[whatwg] Exposing filenames in DataTransfer
dcheng at chromium.org
Mon Oct 18 15:15:27 PDT 2010
Sorry, I'm using "properties" as a generic term for different types of data
that might be set in a drag. A lot of file managers try to be helpful and
populate alternative metadata for a file. Some of this metadata contains
file system paths. If the web dragging clipboard mirrors the native dragging
clipboard, then the metadata will be visible to web apps. In this example,
if you were on Linux with my patch, you could call
event.dataTransfer.getData("x-special/gnome-icon-list") while handling a
drop and the returned string would contain the file system path.
On Mon, Oct 18, 2010 at 14:12, Tab Atkins Jr. <jackalmage at gmail.com> wrote:
> On Mon, Oct 18, 2010 at 1:59 PM, Daniel Cheng <dcheng at chromium.org> wrote:
> > However, this leads to issues like file system paths being exposed
> > properties like "x-special/gnome-icon-list" or even "text/plain". What is
> > the expected behavior here? Mirroring the native dragging clipboard
> > for a much richer interaction with the system, but I'm not sure if we
> > to go out of our way to try to scrub all paths from the drag. After all,
> > you're dropping the file on the page, you're already exposing the
> > of the file, which are probably much more interesting than just the path.
> Could you provide some more detail? I have no idea what you mean by
> "However, this leads to issues like file system paths being exposed
> through properties like "x-special/gnome-icon-list" or even
> "text/plain"." Those aren't properties, nor do they expose
> file-system paths.
> Do you perhaps mean that they expose generally the origin of the file,
> such that you know if you see "x-special/gnome-icon-list" that the
> file is probably coming from wherever gnome stores that kind of file?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the whatwg