assuming its in a module, we can use async syntax

const toolbox = await fetch("./toolbox.xml").then(data => data.text());

or if its not

1
2
3
4
5
6
fetch("./toolbox.xml")
    .then(data => data.text())
    .then(data => {
        const toolbox = data;
        //inject blockly
    })
Edit

Pub: 27 May 2024 18:33 UTC

Views: 22