MCPcopy Create free account
hub / github.com/hoothin/UserScripts / blobToDataURL

Function blobToDataURL

DownloadAllContent/DownloadAllContentSavaAsZIP.user.js:57–68  ·  view source on GitHub ↗
(blob)

Source from the content-addressed store, hash-verified

55 }
56
57 async function blobToDataURL(blob) {
58 return await new Promise((resolve) => {
59 var a = new FileReader();
60 a.readAsDataURL(blob);
61 a.onload = function (e) {
62 resolve(e.target.result);
63 };
64 a.onerror = function (e) {
65 resolve(null);
66 };
67 });
68 }
69
70 async function urlToBlob(url) {
71 return await new Promise((resolve) => {

Callers 1

recognizeImageFunction · 0.70

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected