// Custom *.sjs file specifically for the needs of // https://bugzilla.mozilla.org/show_bug.cgi?id=1271173 "use strict"; Components.utils.importGlobalProperties(["URLSearchParams"]); const TEST_NAVIGATIONAL_UPGRADE = `
clickme `; const FRAME_NAV = ` `; const DOC_NAV = ` `; function handleRequest(request, response) { const query = new URLSearchParams(request.queryString); response.setHeader("Cache-Control", "no-cache", false); response.setHeader("Content-Type", "text/html", false); if (query.get("csp")) { response.setHeader("Content-Security-Policy", query.get("csp"), false); } if (query.get("action") === "perform_navigation") { response.write(TEST_NAVIGATIONAL_UPGRADE); return; } if (query.get("action") === "framenav") { response.write(FRAME_NAV); return; } if (query.get("action") === "docnav") { response.write(DOC_NAV); return; } // we should never get here, but just in case // return something unexpected response.write("do'h"); }