prop/lib/microwaveprop_web/components/layouts/root.html.heex
Graham McIntire abe0aa9ec6 Pin referrer policy so OSM tile requests always send a Referer
OSM's tile usage policy requires a Referer header identifying the site.
strict-origin-when-cross-origin is the current browser default and sends
the origin on HTTPS→HTTPS cross-origin requests; pinning it explicitly
prevents silently losing the header if a browser default ever changes.
2026-04-09 09:30:23 -05:00

50 lines
2.2 KiB
Text

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="csrf-token" content={get_csrf_token()} />
<%!--
OpenStreetMap's tile usage policy requires a Referer header identifying
the site using their tiles. strict-origin-when-cross-origin sends just
the origin (e.g. https://prop.w5isp.com) on cross-origin HTTPS requests,
which is the minimum OSM asks for. Explicit so we don't silently lose
the Referer if a future browser default changes.
--%>
<meta name="referrer" content="strict-origin-when-cross-origin" />
<.live_title default="North Texas Microwave Society" suffix=" · NTMS">
{assigns[:page_title]}
</.live_title>
<link rel="preconnect" href="https://a.tile.openstreetmap.org" crossorigin />
<link rel="preconnect" href="https://b.tile.openstreetmap.org" crossorigin />
<link rel="preconnect" href="https://c.tile.openstreetmap.org" crossorigin />
<link rel="dns-prefetch" href="https://a.tile.openstreetmap.org" />
<link rel="dns-prefetch" href="https://b.tile.openstreetmap.org" />
<link rel="dns-prefetch" href="https://c.tile.openstreetmap.org" />
<link phx-track-static rel="stylesheet" href={~p"/assets/css/app.css"} />
<script defer phx-track-static type="text/javascript" src={~p"/assets/js/app.js"}>
</script>
<script>
(() => {
const setTheme = (theme) => {
if (theme === "system") {
localStorage.removeItem("phx:theme");
document.documentElement.removeAttribute("data-theme");
} else {
localStorage.setItem("phx:theme", theme);
document.documentElement.setAttribute("data-theme", theme);
}
};
if (!document.documentElement.hasAttribute("data-theme")) {
setTheme(localStorage.getItem("phx:theme") || "system");
}
window.addEventListener("storage", (e) => e.key === "phx:theme" && setTheme(e.newValue || "system"));
window.addEventListener("phx:set-theme", (e) => setTheme(e.target.dataset.phxTheme));
})();
</script>
</head>
<body>
{@inner_content}
</body>
</html>