Could you share the javascript you use to generate the blob and convert the blob/url to base64? We might be able to improve the extensions if it works without needing a server.
I have this that works well, running the html file from the assets, locally on the app, and returns the base64 to the app using the webviewstring:
HTML
<script>
//Attribution: https://stackoverflow.com/questions/18650168/convert-blob-to-base64
const data = "Hello, world!";
const blob = new Blob([data], { type: "text/plain" });
const blobUrl = URL.createObjectURL(blob);
blobUrlToBase64(blobUrl).then(base64 => {
console.log(base64);
console.log(atob(base64));
if (window.AppInventor) {
window.AppInventor.setWebViewString(base64);
}
});
URL.revokeObjectURL(blobUrl);
async function blobUrlToBase64(blobUrl) {
try {
const response = await fetch(blobUrl);
const blob = await response.blob();
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onloadend = () => {
const base64 = reader.result.split(',')[1];
resolve(base64);
};
reader.onerror = reject;
reader.readAsDataURL(blob);
});
} catch (error) {
reject(error);
}
}
</script>