/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
const RESPONSE = `
Bug 1172870 - page opened by ServiceWorkerClients.OpenWindow
client.sjs
`;
function handleRequest(request, response) {
Components.utils.importGlobalProperties(["URLSearchParams"]);
let query = new URLSearchParams(request.queryString);
// If the request has been marked to be isolated with COOP+COEP, set the appropriate headers.
if (query.get("crossOriginIsolated") == "true") {
response.setHeader("Cross-Origin-Opener-Policy", "same-origin", false);
}
// Always set the COEP and CORP headers, so that this document can be framed
// by a document which has also set COEP to require-corp.
response.setHeader("Cross-Origin-Embedder-Policy", "require-corp", false);
response.setHeader("Cross-Origin-Resource-Policy", "cross-origin", false);
response.setHeader("Content-Type", "text/html", false);
response.write(RESPONSE);
}