Use Blob constructor when available instead of deprecated MozBlobBuilder.

This commit is contained in:
Brendan Dahl 2012-09-22 09:44:49 -07:00
parent 130447755e
commit 739ee47865
3 changed files with 15 additions and 8 deletions

View file

@ -662,3 +662,12 @@ var StatTimer = (function StatTimerClosure() {
};
return StatTimer;
})();
PDFJS.createBlob = function createBlob(data, contentType) {
if (typeof Blob === 'function')
return new Blob([data], { type: contentType });
// Blob builder is deprecated in FF14 and removed in FF18.
var bb = new MozBlobBuilder();
bb.append(data);
return bb.getBlob(contentType);
};