Merge branch 'master' into sound

This commit is contained in:
2022-03-05 23:10:14 +01:00
9 changed files with 77 additions and 60 deletions

View File

@@ -15,8 +15,8 @@
<div id="centered">
<canvas id="screen" width="320" height="240">
</canvas>
<div id="timer" hidden="true"></div>
<div id="message"></div>
<div id="timer" hidden="true"></div>
<div id="message"></div>
<button id="cartButton" style="visibility:hidden">Load cart...</button>
</div>
<div id="footer">

View File

@@ -79,7 +79,9 @@ if(location.hash.length != 0) {
url += 'cart.uw8';
}
try {
await uw8.runModuleFromURL(url, true);
if(!await uw8.runModuleFromURL(url, true)) {
setupLoad();
}
} catch(e) {
setupLoad();
}

View File

@@ -326,10 +326,11 @@ export default function MicroW8(screen, config = {}) {
async function runModuleFromURL(url, keepUrl) {
let response = await fetch(url);
let type = response.headers.get('Content-Type');
if(type && type.includes('html')) {
throw false;
if((type && type.includes('html')) || response.status != 200) {
return false;
}
runModule(await response.arrayBuffer(), keepUrl || devkitMode);
return true;
}
return {