From 4c9ab5fb0dc4944042e754bd222e3d3ef8769ebd Mon Sep 17 00:00:00 2001 From: Benjamin VanderSloot Date: Thu, 20 Nov 2025 13:17:47 -0500 Subject: [PATCH 1/3] Add some testing for ancestor bit behavior --- ...ancestor-chain-partitioning.sub.https.html | 54 +++++++++++++++++++ .../resources/intercepting-worker.sub.js | 11 ++++ .../resources/middle-frame.sub.html | 15 ++++++ html/partitioning/resources/popup.sub.html | 15 ++++++ html/partitioning/resources/post-storage.html | 17 ++++++ 5 files changed, 112 insertions(+) create mode 100644 html/partitioning/ancestor-chain-partitioning.sub.https.html create mode 100644 html/partitioning/resources/intercepting-worker.sub.js create mode 100644 html/partitioning/resources/middle-frame.sub.html create mode 100644 html/partitioning/resources/popup.sub.html create mode 100644 html/partitioning/resources/post-storage.html diff --git a/html/partitioning/ancestor-chain-partitioning.sub.https.html b/html/partitioning/ancestor-chain-partitioning.sub.https.html new file mode 100644 index 00000000000000..853c0a055457ad --- /dev/null +++ b/html/partitioning/ancestor-chain-partitioning.sub.https.html @@ -0,0 +1,54 @@ + + + + + + + + + + \ No newline at end of file diff --git a/html/partitioning/resources/intercepting-worker.sub.js b/html/partitioning/resources/intercepting-worker.sub.js new file mode 100644 index 00000000000000..5879a7661dcef2 --- /dev/null +++ b/html/partitioning/resources/intercepting-worker.sub.js @@ -0,0 +1,11 @@ +self.addEventListener("fetch", (event) => { + let url = new URL(event.request.url); + if (url.searchParams.has("intercept")) { + if (url.hostname == "{{hosts[][]}}") { + url.hostname = "{{hosts[alt][www]}}" + } else { + url.hostname = "{{hosts[][]}}"; + } + return event.respondWith(fetch(url)); + } +}); \ No newline at end of file diff --git a/html/partitioning/resources/middle-frame.sub.html b/html/partitioning/resources/middle-frame.sub.html new file mode 100644 index 00000000000000..62ad3712659de3 --- /dev/null +++ b/html/partitioning/resources/middle-frame.sub.html @@ -0,0 +1,15 @@ + + + + + + diff --git a/html/partitioning/resources/popup.sub.html b/html/partitioning/resources/popup.sub.html new file mode 100644 index 00000000000000..70e8d3060945d1 --- /dev/null +++ b/html/partitioning/resources/popup.sub.html @@ -0,0 +1,15 @@ + + + + + + diff --git a/html/partitioning/resources/post-storage.html b/html/partitioning/resources/post-storage.html new file mode 100644 index 00000000000000..42d7bb46e26e3a --- /dev/null +++ b/html/partitioning/resources/post-storage.html @@ -0,0 +1,17 @@ + + + + + From bbc9cc18142f1bd30985f9c672026eddf74da0d3 Mon Sep 17 00:00:00 2001 From: Benjamin VanderSloot Date: Fri, 21 Nov 2025 12:53:57 -0500 Subject: [PATCH 2/3] Cleanup + CORS --- html/partitioning/ancestor-chain-partitioning.sub.https.html | 2 +- html/partitioning/resources/intercepting-worker.sub.js | 2 +- html/partitioning/resources/middle-frame.sub.html | 1 - html/partitioning/resources/popup.sub.html | 1 - html/partitioning/resources/post-storage.html | 1 - html/partitioning/resources/post-storage.html.sub.headers | 1 + 6 files changed, 3 insertions(+), 5 deletions(-) create mode 100644 html/partitioning/resources/post-storage.html.sub.headers diff --git a/html/partitioning/ancestor-chain-partitioning.sub.https.html b/html/partitioning/ancestor-chain-partitioning.sub.https.html index 853c0a055457ad..8bf670dcca6de2 100644 --- a/html/partitioning/ancestor-chain-partitioning.sub.https.html +++ b/html/partitioning/ancestor-chain-partitioning.sub.https.html @@ -51,4 +51,4 @@ localStorage.removeItem("aa-sw-redir"); }, "Expected unpartitioned data in same-origin subframe redirected by service worker") - \ No newline at end of file + diff --git a/html/partitioning/resources/intercepting-worker.sub.js b/html/partitioning/resources/intercepting-worker.sub.js index 5879a7661dcef2..65c096da78ff62 100644 --- a/html/partitioning/resources/intercepting-worker.sub.js +++ b/html/partitioning/resources/intercepting-worker.sub.js @@ -8,4 +8,4 @@ self.addEventListener("fetch", (event) => { } return event.respondWith(fetch(url)); } -}); \ No newline at end of file +}); diff --git a/html/partitioning/resources/middle-frame.sub.html b/html/partitioning/resources/middle-frame.sub.html index 62ad3712659de3..78c31e5f94d231 100644 --- a/html/partitioning/resources/middle-frame.sub.html +++ b/html/partitioning/resources/middle-frame.sub.html @@ -1,6 +1,5 @@ - + + diff --git a/html/partitioning/resources/popup.sub.html b/html/partitioning/resources/popup.sub.html index 77302064a58b68..b6ae4359a210b0 100644 --- a/html/partitioning/resources/popup.sub.html +++ b/html/partitioning/resources/popup.sub.html @@ -10,5 +10,6 @@ window.opener.postMessage(event.data, "*"); }); let innerFrame = document.getElementById("innerFrame"); - innerFrame.src ="//{{hosts[alt][www]}}:{{ports[https][0]}}{{location[path]}}/../../resources/post-storage.html{{location[query]}}"; + let queryParams = "{{location[query]}}".replace("&", "&"); // un-escape the templated string. + innerFrame.src ="//{{hosts[alt][www]}}:{{ports[https][0]}}{{location[path]}}/../../resources/post-storage.sub.html" + queryParams; diff --git a/html/partitioning/resources/popup.sub.html.headers b/html/partitioning/resources/popup.sub.html.headers new file mode 100644 index 00000000000000..e2d945d55669ec --- /dev/null +++ b/html/partitioning/resources/popup.sub.html.headers @@ -0,0 +1 @@ +Content-Security-Policy: sandbox allow-scripts; \ No newline at end of file diff --git a/html/partitioning/resources/post-storage.sub.html b/html/partitioning/resources/post-storage.sub.html new file mode 100644 index 00000000000000..6e96d21c241c80 --- /dev/null +++ b/html/partitioning/resources/post-storage.sub.html @@ -0,0 +1,21 @@ + + + + diff --git a/html/partitioning/resources/post-storage.sub.html.headers b/html/partitioning/resources/post-storage.sub.html.headers new file mode 100644 index 00000000000000..1f73a789e4e2a5 --- /dev/null +++ b/html/partitioning/resources/post-storage.sub.html.headers @@ -0,0 +1 @@ +Access-Control-Allow-Origin: {{header_or_default(Origin, *)}} \ No newline at end of file