summaryrefslogtreecommitdiff
path: root/dist/wipfel
diff options
context:
space:
mode:
Diffstat (limited to 'dist/wipfel')
-rw-r--r--dist/wipfel/index.html15
-rw-r--r--dist/wipfel/loader.js4
2 files changed, 15 insertions, 4 deletions
diff --git a/dist/wipfel/index.html b/dist/wipfel/index.html
index 67d0378..e56de5c 100644
--- a/dist/wipfel/index.html
+++ b/dist/wipfel/index.html
@@ -2,6 +2,16 @@
<html lang="en">
<head>
<meta charset="utf-8" />
+ <!--
+ Content-Security-Policy (ships with the page so it applies on any
+ static host). Scripts only from this origin, no inline JS; wasm
+ compilation is the one scoped exception. Inline style *attributes*
+ are used by the Yew views, hence style-src unsafe-inline.
+ -->
+ <meta
+ http-equiv="Content-Security-Policy"
+ content="default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; img-src 'self' blob: data:; connect-src 'self' blob: data:; style-src 'self' 'unsafe-inline'"
+ />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="theme-color" content="#101014" media="(prefers-color-scheme: dark)" />
<meta name="theme-color" content="#e9eaf0" media="(prefers-color-scheme: light)" />
@@ -9,9 +19,6 @@
<link rel="stylesheet" href="style.css" />
</head>
<body>
- <script type="module">
- import init from './wipfel.js';
- init();
- </script>
+ <script type="module" src="loader.js"></script>
</body>
</html>
diff --git a/dist/wipfel/loader.js b/dist/wipfel/loader.js
new file mode 100644
index 0000000..8880478
--- /dev/null
+++ b/dist/wipfel/loader.js
@@ -0,0 +1,4 @@
+// External loader so the page needs no inline <script>, keeping
+// `script-src 'self'` in the Content-Security-Policy sufficient.
+import init from './wipfel.js';
+init();