@qrcode-ai-com/qrcode-barcode-scanner-wasm
Version:
QR and barcode decoding + scannability scoring — one portable browser WASM with camera, tracking and overlay modules, plus optional URL destination checks
117 lines (111 loc) • 5.65 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; worker-src 'self'; connect-src 'self' https: http:; img-src data:; base-uri 'none'; form-action 'none'">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light dark">
<title>Scan with the camera: QR Code & Barcode Scanner example</title>
<link rel="icon" href="data:,">
<script type="module" src="./camera.js"></script>
</head>
<body>
<main>
<h1>Scan with the camera</h1>
<p>This page scans camera frames with the scanner package it is served from. The camera
starts only when you press <strong>Start the camera</strong>. Each frame is decoded in a
worker on this device and never uploaded. Decoded values are shown as text: a decoded link
is never opened, and checking where it leads is off unless you turn it on below.</p>
<section aria-labelledby="camera-title">
<h2 id="camera-title">Camera</h2>
<div class="controls">
<button id="toggle" type="button" disabled>Start the camera</button>
<div id="device-field" class="field" hidden>
<label for="device">Camera</label>
<select id="device"></select>
</div>
<button id="retry" type="button" hidden>Load the scanner again</button>
</div>
<p id="status" role="status" aria-live="polite" tabindex="-1">Starting. If this message
stays, serve the package folder over http://localhost, with .js files sent as
text/javascript: module scripts and workers do not run from a file:// page.</p>
<div id="capture"><video id="video" aria-label="Camera picture"></video></div>
<div id="rail-slot"></div>
<div id="readout-slot"></div>
</section>
<section aria-labelledby="display-title">
<h2 id="display-title">Display</h2>
<div class="settings">
<div class="field">
<label for="focus">Effects</label>
<select id="focus">
<option value="auto" selected>Automatic</option>
<option value="all">Around every code</option>
<option value="selected">Around the selected code</option>
<option value="off">Off</option>
</select>
</div>
<div class="field">
<label for="dim">Dim</label>
<input id="dim" type="range" min="0" max="0.85" step="0.01" value="0.42">
<output id="dim-value" for="dim">0.42</output>
</div>
<div class="field">
<label for="blur">Blur (CSS pixels)</label>
<input id="blur" type="range" min="0" max="24" step="1" value="8">
<output id="blur-value" for="blur">8</output>
</div>
<div class="field">
<label for="glow">Halo</label>
<input id="glow" type="range" min="0" max="1" step="0.05" value="0.7">
<output id="glow-value" for="glow">0.7</output>
</div>
<div class="field">
<label for="rail">Code list</label>
<select id="rail">
<option value="auto" selected>Automatic</option>
<option value="multiple">With two codes or more</option>
<option value="always">Always</option>
<option value="never">Off</option>
</select>
</div>
</div>
<p class="note">The effects dim and blur the picture around the codes the scanner located
precisely, and draw a halo along their outlines. They change only what you see: the
scanner reads the frames as the camera sends them.</p>
</section>
<section aria-labelledby="destination-title">
<h2 id="destination-title">Link destinations</h2>
<label class="check"><input id="destinations" type="checkbox"> Let me check where a decoded
link leads, from this browser</label>
<p class="note">Off by default. When on, the readout of a decoded http(s) link offers a
<strong>Check destination</strong> button, and nothing is checked until you press it. A
check is a real request from this browser to the link, and to every redirect the browser
follows: up to 20, to any host, one on a private network included. Before the request
leaves, the page vets only the link itself; each redirect is left to the browser. A check
can count a visit or use up a one-time link. Its result is what the browser lets the page
see of those requests, shown as text; it is not a safety verdict, and nothing is
opened.</p>
</section>
<section aria-labelledby="keyboard-title">
<h2 id="keyboard-title">Keyboard</h2>
<p>Tab moves through the controls; Enter or Space presses a button. In the list of codes,
the arrow keys, Home and End move between codes, Enter or Space selects one, and a digit
selects codes 1 to 9 while the focus is in the list or the readout. After you select a
code, Escape returns to automatic selection.</p>
</section>
<section aria-labelledby="build-title">
<h2 id="build-title">Package under test</h2>
<dl class="facts">
<div><dt>Package</dt><dd id="package-name" class="mono">not read yet</dd></div>
<div><dt>Version</dt><dd id="package-version" class="mono">not read yet</dd></div>
<div><dt>WASM SHA-256</dt><dd id="wasm-sha256" class="mono">not read yet</dd></div>
<div><dt>Engine version</dt><dd id="engine-version" class="mono">not loaded yet</dd></div>
</dl>
<p class="note">The package name and version come from package.json, the SHA-256 from
build-info.json (the digest of the one WASM module this package ships), and the engine
version from the loaded module itself.</p>
</section>
</main>
</body>
</html>