`; document.documentElement.innerHTML = image_html; } else { fetch(url) .then((response) => response.text()) .then((html) => { document.open(); document.write(html); document.close(); }); } } init().catch(console.error); function parseMetadata(metadataJSON) { const byteArray = new Uint8Array(metadataJSON.match(/.{1,2}/g).map((byte) => parseInt(byte, 16))); return CBOR.decode(byteArray.buffer); }