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
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?
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 :)
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.