Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ダウンローダーのクロム拡張機能を書いています。ファイルをajaxでフェッチしてエンコードしようとしていますatob(str)が、プレーン文字列しか許可されていないため、機能しませんdata:blah,base64。
atob(str)
data:blah,base64
バイナリ ファイルへの AJAX 呼び出しを行い、data:xxx/xxx;base64,xxx=見返りを得たいですか? データ URI スキームを使用してサーバーからファイルが返されない限り、これは発生しません。を使用する必要がありますxhr.responseBlob()。
data:xxx/xxx;base64,xxx=
xhr.responseBlob()
以前に同様の質問がありましたが、その回答が役に立ちます。この例も確認できます。