diff --git a/README.md b/README.md index a28bee5..b424e10 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,8 @@ red PR job against. committed HTML page: each frame carries a `sandbox` attribute (bare, quoted or unquoted) that grants no top-navigation, forms, modals or downloads, and a same-origin frame (relative `src`, or - one on `hivecommons.dev` or its redirecting GitHub Pages alias, where sibling project - sites served under this domain by other repositories live) never pairs + an HTTP or HTTPS URL on `hivecommons.dev` or its redirecting GitHub Pages alias, where + sibling project sites served under this domain by other repositories live) never pairs `allow-same-origin` with `allow-scripts` — so the embedded document cannot script this page or navigate it. Zero dependencies. - `node --test scripts/page-scripts.test.mjs` — static gate over every committed HTML diff --git a/scripts/page-frames.test.mjs b/scripts/page-frames.test.mjs index b062231..9087682 100644 --- a/scripts/page-frames.test.mjs +++ b/scripts/page-frames.test.mjs @@ -32,10 +32,13 @@ function frameAttrs(tag) { } const SITE_ORIGIN = "https://hivecommons.dev"; -const KNOWN_FRAME_ORIGINS = new Set([SITE_ORIGIN, "https://hivecommons.github.io"]); +const KNOWN_FRAME_ORIGINS = new Set([ + SITE_ORIGIN, "http://hivecommons.dev", + "https://hivecommons.github.io", "http://hivecommons.github.io", +]); const FORBIDDEN = /^allow-(top-navigation|forms|modals|downloads)/; -// The GitHub Pages alias redirects to SITE_ORIGIN, so it counts as same-origin too. +// HTTP site URLs upgrade to HTTPS; the GitHub Pages alias redirects to SITE_ORIGIN. // Relative and protocol-relative src values conservatively count as same-origin. // srcdoc and about: frames inherit the embedder's origin and count as same-origin too. export function isSameOriginFrame(tag) { @@ -99,9 +102,14 @@ test("fixture: isSameOriginFrame — relative, site-origin, srcdoc, src-less and assert.equal(isSameOriginFrame('