Closed Bug 572139 Opened 10 years ago Closed 10 years ago

File.url from a dropped file doesn't work as source for images

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows 7
defect
Not set

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: paul, Assigned: sicking)

References

Details

Setting the src attribute of an image element with the url property of a File object doesn't work.

See the test here:
http://people.mozilla.com/~prouget/bugs/fileurl.html
This worksforme if I select the file using an <input type="file">.  And for the drop case, if I look at my error console I see:

  Security Error: Content at http://people.mozilla.com/~prouget/bugs/fileurl.html
  may not load data from moz-filedata:ab11527f-ad10-2a41-928f-50a676a4a381.

So presumably we're not giving dropped files the principal of the page we drop into.  Perhaps we should.
Summary: File.url doesn't work as source for images → File.url from a dropped file doesn't work as source for images
Thanks for finding this. We should indeed give dropped files the correct principal.
Assignee: nobody → jonas
blocking2.0: --- → beta2+
blocking2.0: beta2+ → betaN+
Duplicate of this bug: 581767
Any update here? I'd like to use File.url in my coming demos :)
Just a note to say that I get this crash every time I try to use File.url 
http://crash-stats.mozilla.com/report/index/fa19fe1d-241d-447a-9f2a-4a8432100913
(on last nigthlies)
I am still waiting since the post on hacks.mozila.org
Kyle, does your patch for bug 594964 fix this?
This should be fixed now, though the syntax is no longer file.url.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.