window.URL.createObjectURL(blob); is undefined in my application window.URL.createObjectURL(blob); is undefined in my application angularjs angularjs

window.URL.createObjectURL(blob); is undefined in my application


I figure out the solution for this by using following script from Arun & @Phil comments. Thanks to both of them.

Its not with any library, in my application somewhere in unused code, there a global URL object which is overriding the window.URL.

I found this by using the following code:

(function () {        var _createObjectURL = window.URL.createObjectURL;                Object.defineProperty(window.URL, 'createObjectURL', {                set: function (value) {                console.trace('set createObjectURL')                        _createObjectURL = value;                },                        get: function () {                        console.trace('get createObjectURL')                                return _createObjectURL;                        }                })                })();                (function () {                var _URL = window.URL;                        Object.defineProperty(window, 'URL', {                        set: function (value) {                        console.trace('set URL')                                _URL = value;                        },                                get: function () {                                console.trace('get URL')                                        return _URL;                                }                        })                        })();