Hi,
I wrote a custom Javascript function to preload images on my site (completely unrelated to GSAP). I used the Object prototype method.
Object.prototype.preloadImages = function(callback) {
/* ... */
};
This is how it looks. The code inside is just plain JS.
But whenever I add it to my project, GSAP throws an error: GSAP encountered missing dependency: com.greensock.preloadImages.
Then it logs: Uncaught TypeError: o.parse is not a function (logs this error over and over)
Seems like GSAP is seeing the new function and trying to do something related to it.
Any suggestions on how to fix it?
I could just switch it from Object.prototype to a regular function; but I prefer having it this way. It's a re-usable plugin that I include in lots of projects, so I don't really want to change it just for this.