summaryrefslogtreecommitdiffstats
path: root/docshell/test/mochitest/file_bug1742865_outer.sjs
blob: bad8b23f00b2484eb3e442397d6e1f36a84266ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Cu.importGlobalProperties(["URLSearchParams"]);

function handleRequest(request, response) {
  response.write(
    `<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <script>
    window.addEventListener("message", ({ data }) => {
      if (data == "loadNext") {
        location.href += "&loadnext=1";
        return;
      }
      // Forward other messages to the frame.
      document.getElementById("frame").contentWindow.postMessage(data, "*");
    });
  </script>
</head>
<body>
  <iframe src="file_bug1742865.sjs?${request.queryString}" id="frame"></iframe>
</body>
</html>`
  );
}