Files
Reaktor/tools/shell.html
T
Roman ChojnackiandClaude Opus 5.5 63b4fe6dc1 Web page: a Content-Security-Policy
The page allowed any script. It now sets a policy: scripts only from its own origin, plus WebAssembly; images from its own origin, data: and blob:, which the app creates; nothing from elsewhere. The inline script moved to shell.js, copied beside the page like keylog.js, and the canvas's inline context-menu handler went with it. Checked in headless Edge: showcase, notepad and simple start and draw the same pixels with the policy as without, the showcase's accessibility tree is the same, and the console shows no violation, with ?keylog too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 23:27:29 +02:00

115 lines
2.8 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; object-src 'none'; base-uri 'none'; form-action 'none'">
<title>Reaktor</title>
<link rel="icon" type="image/svg+xml" href="reaktor-icon.svg">
<link rel="alternate icon" type="image/png" href="reaktor-icon.png">
<style>
html, body {
margin: 0;
height: 100%;
background: #f7f7f7;
overflow: hidden;
}
@media (prefers-color-scheme: dark) {
html, body { background: #252525; }
}
#canvas {
display: block;
outline: none;
transform: translate3d(0, 0, 0);
image-rendering: pixelated;
image-rendering: crisp-edges;
image-rendering: -webkit-optimize-contrast;
}
#status {
--ink: #333333;
--muted: #6a6a6a;
--track: #e2e2e2;
--fill: #0070e0;
position: fixed;
inset: 0;
display: grid;
place-content: center;
justify-items: center;
gap: 14px;
color: var(--ink);
font: 14px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI",
Roboto, sans-serif;
transition: opacity 240ms ease-out;
pointer-events: none;
}
@media (prefers-color-scheme: dark) {
#status {
--ink: #f7f7f7;
--muted: #c0c0c0;
--track: #3a3a3a;
--fill: #56c7ff;
}
}
#status.done { opacity: 0; }
#status img {
width: 64px;
height: 64px;
animation: breathe 1.6s ease-in-out infinite;
}
#status .name {
font-size: 20px;
font-weight: 600;
letter-spacing: 0.02em;
}
#status .bar {
width: 220px;
height: 4px;
border-radius: 2px;
background: var(--track);
overflow: hidden;
}
#status .bar div {
width: 30%;
height: 100%;
border-radius: 2px;
background: var(--fill);
animation: sweep 1.2s ease-in-out infinite;
}
#status .bar.known div {
animation: none;
transition: width 160ms linear;
}
#status .text {
color: var(--muted);
font-size: 12px;
font-variant-numeric: tabular-nums;
}
@keyframes breathe { 50% { transform: scale(0.94); opacity: 0.85; } }
@keyframes sweep {
from { transform: translateX(-100%); }
to { transform: translateX(340%); }
}
@media (prefers-reduced-motion: reduce) {
#status img, #status .bar div { animation: none; }
}
</style>
</head>
<body>
<div id="status" role="status" aria-live="polite">
<img src="reaktor-icon.svg" alt="">
<div class="name">Reaktor</div>
<div class="bar"><div></div></div>
<div class="text">Loading&hellip;</div>
</div>
<canvas id="canvas" tabindex="-1">
</canvas>
<script src="shell.js"></script>
{{{ SCRIPT }}}
</body>
</html>