1
Chrome 확장 프로그램 내에서 캔버스 이미지에서 BLOB를 만들려고하지만 BLOB를 만들 때 "잡히지 않은 TypeError : 개체가 함수가 아닙니다"오류가 발생합니다. 어떤 방법!Chrome 확장 Blob 데이터 문제
var blob = new Blob();
var blob = new Blob(['body { color: red; }'], {type: 'text/css'});
은 위의 오류와 함께 실패하는 두 가지 예입니다. 사실은 내가 (도 실패하는)이다 사용하고있는 코드 ...
function dataURItoBlob(dataURI) {
'use strict'
var byteString,
mimestring
if(dataURI.split(',')[0].indexOf('base64') !== -1) {
byteString = atob(dataURI.split(',')[1])
} else {
byteString = decodeURI(dataURI.split(',')[1])
}
mimestring = dataURI.split(',')[0].split(':')[1].split(';')[0]
var content = new Array();
for (var i = 0; i < byteString.length; i++) {
content[i] = byteString.charCodeAt(i)
}
return new Blob([new Uint8Array(content)], {type: mimestring});
}
내가 크롬 새로운 모양을 지원하지 않습니다 가정 오전 BLOB에 DataURL를 변환하려고 ??