]> zoso.dev Git - nemo-wallet.git/commitdiff
Start testing QR code scanner.
authorChris Duncan <chris@zoso.dev>
Thu, 31 Oct 2024 01:26:33 +0000 (18:26 -0700)
committerChris Duncan <chris@zoso.dev>
Thu, 31 Oct 2024 01:26:33 +0000 (18:26 -0700)
app/pages/nemo-wallet.html

index 93b3cbafece383c77c7c43f83f9250539f8829fe..8d311950cd7aabfd69ec3eeccaef4adfe5422f87 100644 (file)
@@ -4,8 +4,18 @@
        <meta charset="utf-8" />
        <meta lang="en" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
+       <script
+               type="module"
+               src="https://fastly.jsdelivr.net/npm/barcode-detector@2/dist/es/side-effects.min.js"></script>
        <script>
                let libnemo, css
+               const barcodeDetector = new BarcodeDetector({
+                       formats: ["qr_code"],
+               })
+               const imageFile = await fetch(
+                       "https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=Hello%20world!",
+               ).then(resp => resp.blob())
+               barcodeDetector.detect(imageFile).then(console.log)
 
                const observer = new MutationObserver((mutations) => {
                        for (const mutation of mutations) {