diff --git a/Gulpfile.js b/Gulpfile.js index 275ef7a0..4519ad0d 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -39,7 +39,11 @@ gulp.task('scripts', function(){ var bundler = browserify('./app/application.js') bundle(bundler, './application.js') .pipe(gulp.dest('./build/assets/js/')) - .pipe(refresh(lrserver)); + + var polyfillBundler = browserify('./app/polyfill.js') + bundle(polyfillBundler, './polyfill.js') + .pipe(gulp.dest('./build/assets/js/')) + .pipe(refresh(lrserver)) }); gulp.task('html', function(){ diff --git a/app/index.html b/app/index.html index 676defa5..ad08625b 100644 --- a/app/index.html +++ b/app/index.html @@ -14,10 +14,7 @@
- + diff --git a/app/polyfill.js b/app/polyfill.js new file mode 100644 index 00000000..af71e5d1 --- /dev/null +++ b/app/polyfill.js @@ -0,0 +1,7 @@ +//monkey patch Uint8ClampedArray for android API level 15 and below +var TA = require('typedarray') +window.Uint8ClampedArray = window.Uint8ClampedArray || TA.Uint8ClampedArray +window.Float64Array = window.Float64Array || TA.Float64Array + +//monkey patch URL for safari 6 +window.URL = window.URL || window.webkitURL diff --git a/package.json b/package.json index 4a805bd0..6e392b8b 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,8 @@ "es3ify": "~0.1.3", "uniqueify": "~1.0.0", "arrival": "~1.0.0", - "uglifyify": "~2.4.0" + "uglifyify": "~2.4.0", + "typedarray": "0.0.6" }, "aperture": { "sources": [