From 9e1f46668b220458be6f406e2e6214375a5ca092 Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Thu, 9 Jan 2020 16:54:33 +0100 Subject: [PATCH] COOP: test COOP popup from a CSP-sandboxed popup Part of #18354. --- .../coop-csp-sandbox.https.html | 24 +++++++++++++++++++ .../resources/csp-sandbox.py | 21 ++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 html/cross-origin-opener-policy/coop-csp-sandbox.https.html create mode 100644 html/cross-origin-opener-policy/resources/csp-sandbox.py diff --git a/html/cross-origin-opener-policy/coop-csp-sandbox.https.html b/html/cross-origin-opener-policy/coop-csp-sandbox.https.html new file mode 100644 index 00000000000000..259d484df2cbf7 --- /dev/null +++ b/html/cross-origin-opener-policy/coop-csp-sandbox.https.html @@ -0,0 +1,24 @@ + +CSP sandboxed Cross-Origin-Opener-Policy popup should result in a network error + + + +
+ diff --git a/html/cross-origin-opener-policy/resources/csp-sandbox.py b/html/cross-origin-opener-policy/resources/csp-sandbox.py new file mode 100644 index 00000000000000..adaf50b8688162 --- /dev/null +++ b/html/cross-origin-opener-policy/resources/csp-sandbox.py @@ -0,0 +1,21 @@ +def main(request, response): + coop = request.GET.first("coop") + coep = request.GET.first("coep") + sandbox = request.GET.first("sandbox") + if coop != "": + response.headers.set("Cross-Origin-Opener-Policy", coop) + if coep != "": + response.headers.set("Cross-Origin-Embedder-Policy", coep) + response.headers.set("Content-Security-Policy", "sandbox " + sandbox + ";") + + # Open a popup to coop-coep.py with the same parameters (except sandbox) + response.content = """ + + + + +"""