summaryrefslogtreecommitdiffstats
path: root/docshell/test/mochitest/file_bug1742865_outer.sjs
blob: f5e689a5261ee95763808183f58571f4cd21b676 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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>`
  );
}