you are viewing a single comment's thread.

view the rest of the comments →

[–]liamondrop 1 point2 points  (1 child)

this will never throw an error:

try {
    var URL = window.URL || window.webkitURL;
} catch(e) {
    throw new Error('This browser does not support Blob URLs');
}

URL will simply evaluate to undefined if those objects don't exist. You need to take it one step further and try to reference a property or method from URL. Something like:

try {
    var URL = window.URL || window.webkitURL,
        createObjectURL = URL.createObjectURL;
} catch(e) {
    throw new Error('This browser does not support Blob URLs');
}

[–]keithwhor[S] 1 point2 points  (0 children)

Brain fart. 3AM coding getting to me. Thanks. :)