summaryrefslogtreecommitdiffstats
path: root/docshell/test/bug530396-noref.sjs
blob: 1ed5f7aa21bfd0033bc83cc2ba920793766e5eaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function handleRequest(request, response) {
  response.setHeader("Content-Type", "text/html");
  response.setHeader("Cache-Control", "no-cache");
  response.write("<body onload='");

  if (!request.hasHeader('Referer')) {
    response.write("window.parent.onloadCount++;");
  }

  if (request.queryString == "newwindow") {
      response.write("if (window.opener) { window.opener.parent.onloadCount++; window.opener.parent.doNextStep(); }");
      response.write("if (!window.opener) window.close();");
      response.write("'>");
  } else {
    response.write("window.parent.doNextStep();'>");
  }

  response.write(request.method + " " + Date.now());
  response.write("</body>");
}