Add a fallback for unsupported browsers

This commit is contained in:
Ingvar Stepanyan
2022-02-09 13:25:01 +00:00
parent 6bad06e549
commit 02208afca8

View File

@@ -50,6 +50,16 @@
} }
} }
</script> </script>
<script type="module" src="index.js"></script> <script type="module">
try {
if (!('usb' in navigator)) {
throw new Error('WebUSB is unsupported');
}
await import('./index.js');
} catch (e) {
console.error(e);
await import('./index-fallback.js');
}
</script>
</head> </head>
</html> </html>