cubiq / add-to-homescreen

Add to home screen call-out for mobile devices
http://cubiq.org/add-to-home-screen
2.29k stars 746 forks source link

Minified version of file throwing error on instantiation. #193

Open sarg3nt opened 9 years ago

sarg3nt commented 9 years ago

JavaScript error in console: Uncaught TypeError: Cannot read property 'debug' of undefined

Here's how I'm loading it.

if (/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)) {
    isMobile = true;
    document.write('<link href="/Content/addtohomescreen.css" rel="stylesheet" />');
    document.write('<script type="text/javascript" src="/Scripts/lazyLoaded/addtohomescreen.min.js"><\/script>');
    document.addEventListener("DOMContentLoaded", function () {
        addToHomescreen();
    });
}

If I load the non minified file it works fine.

sarg3nt commented 9 years ago

For whatever reason, when we had our deployment system minify the source and use it externally, everything is fine.

cubiq commented 9 years ago

yes this would be a very easy fix (I believe I just forgot to update the minified version)

tylercollier commented 9 years ago

@cubiq So can you update the minified version?

kratsg commented 9 years ago

I've got this error btw. I'll use unminified for now.

roccomuso commented 8 years ago

+1, update the minified version please.

mohdhazwan commented 8 years ago

For quick fix (minified version), search for i.debug and replace with this.options.debug

holtkamp commented 8 years ago

:+1: on this, maybe only distribute the minified version in tagged/stable versions on not in master branch?