summaryrefslogtreecommitdiffstats
path: root/docshell/test/mochitest/file_bug1850335_2.html
blob: e2c55a6a04f4bf3619983f13aefe2ae26d25acc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<script>
addEventListener("pageshow", ({ persisted }) => {
  window.blockBFCache = new RTCPeerConnection();

  let bc = new BroadcastChannel("bug1850335");

  bc.addEventListener("message", ({ data: { cmd, arg } }) => {
    bc.close();
    if (cmd == "load") {
      location = arg;
    } else if (cmd == "back") {
      history.back();
    }
  }, { once: true });

  bc.postMessage({ persisted });
});
</script>