Status

()

Core
DOM
VERIFIED INVALID
6 years ago
6 years ago

People

(Reporter: sfornengo, Unassigned)

Tracking

6 Branch
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20100101 Firefox/6.0
Build ID: 20110804171029

Steps to reproduce:

want to use:
objectURL = window.URL.createObjectURL(file);
like here:
https://developer.mozilla.org/en/DOM/window.URL.createObjectURL


Actual results:

return window.URL is undefined

Updated

6 years ago
Component: General → DOM
Product: Firefox → Core
QA Contact: general → general
Does the example at https://developer.mozilla.org/en/Using_files_from_web_applications#Example.3a_Using_object_URLs_to_display_images work for you?
(Reporter)

Comment 2

6 years ago
yes it works !
the problem came from the variable name "URL" in front of my js script:
var URL=window.URL || window.webkitURL;
console.log(URL); // ==> undefined
but solved by changing name variable:
var testURL=window.URL || window.webkitURL;
console.log(testURL); // ==> [object MozURLProperty], ok !
thanks for your help !
Eh, that's why it's better to attach the script/document you use when you file a bug :)
Status: UNCONFIRMED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → INVALID
(Reporter)

Comment 4

6 years ago
for information it was working under chromium, not troubled by variable name.
The sequence of operations here is:

1) var URL: this sets window.URL to undefined.
2) window.URL = window.URL || window.webkitURL: this sets window.URL to the value
   of window.webkitURL in all browsers, since window.URL is undefined and hence
   falsy.

So what you end up with depends on what window.webkitURL evaluates to, which is quite different in WebKit and Gecko.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.