polyfills.HTMLCanvasElement.protoype.toBlob.raw.js Maven / Gradle / Ivy
The newest version!
// HTMLCanvasElement.protoype.toBlob
(function () {
'use strict';
Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {
value: function (callback, type, quality) {
var binStr = atob( this.toDataURL(type, quality).split(',')[1] ),
len = binStr.length,
arr = new Uint8Array(len);
for (var i=0; i