Is it possible to prototype the File object? I currently have the problem that the File object in Firefox 7+ does not have the fileName attribute any more, but the name attribute.
My code relies extensively on fileName and I would like to find an easier way than changing all occurrences.
Try this:
It should have no effect on browsers that have
fileNamebecause the prototype is only looked at if it’s not found in aFileinstance object itself.jsfiddle: http://jsfiddle.net/Sj3B2/2/ (tested in firefox, chrome and opera)
Edited because opera didn’t support
Object.defineProperty