Files
tdkpin/tdkpin-rs/web/index.html
T
ddidderr acb0c20b59 fix(web): vendor the Macroquad browser loader
The page depended on the externally hosted miniquad bundle, which violates a
same-origin `script-src 'self'` policy and makes the game depend on a third
party at runtime. Vendor the current official loader alongside the web assets
and move the WASM `load` call into a local bootstrap script, preserving plugin
registration order without inline JavaScript.

Document the CSP requirement for WebAssembly compilation and same-origin
connections. The vendored bundle is the current response from the official
Macroquad loader URL and was syntax-checked before committing.

Test Plan:
- `just web-build` -- passed
- `node --check web/mq_js_bundle.js web/storage.js web/bootstrap.js` -- passed
- `prettier --check web/storage.js web/bootstrap.js` -- passed
- Browser smoke test with `script-src 'self' 'wasm-unsafe-eval'` and `connect-src 'self'` -- passed; 640x460 canvas and no CSP/script errors
- `git diff --cached --check` -- passed
2026-08-29 17:12:43 +02:00

54 lines
1.2 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, viewport-fit=cover"
/>
<meta
name="description"
content="Play the reconstructed 1995 TDK Pinball Machine in your browser."
/>
<title>TDK Pinball Machine 1.00</title>
<style>
:root {
color-scheme: dark;
background: #000;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
min-width: 640px;
min-height: 460px;
overflow: auto;
background: #000;
}
body {
display: grid;
place-items: center;
}
#glcanvas {
display: block;
width: 640px;
height: 460px;
background: #000;
outline: none;
image-rendering: pixelated;
}
</style>
</head>
<body>
<canvas id="glcanvas" tabindex="1" aria-label="TDK Pinball Machine"></canvas>
<noscript>This game needs JavaScript enabled.</noscript>
<script src="./mq_js_bundle.js"></script>
<script src="./storage.js"></script>
<script src="./bootstrap.js"></script>
</body>
</html>