summaryrefslogtreecommitdiffstats
path: root/docshell/base/crashtests/1804803.sjs
blob: 0486e32048c3c994f7819c4cf0083c5e6f5d1f79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function handleRequest(request, response) {
  let counter = Number(getState("load"));
  const reload = counter == 0 ? "self.history.go(0);" : "";
  setState("load", String(++counter));
  const document = `
<script>
    document.addEventListener('DOMContentLoaded', () => {
      ${reload}
      let url = window.location.href;
      for (let i = 0; i < 50; i++) {
        self.history.pushState({x: i}, '', url + "#" + i);
      }
    });
</script>
`;

  response.write(document);
}