summaryrefslogtreecommitdiffstats
path: root/docshell/test/browser/onload_message.html
blob: 23f6e37396062a46aa0cce1ee03565d2663842bb (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
<html>
  <head>
    <meta charset="utf-8">
    <script>
      addEventListener("load", function() {
        // This file is used in couple of different tests.
        if (opener) {
          opener.postMessage("load", "*");
        } else {
          var bc = new BroadcastChannel("browser_browsingContext");
          bc.onmessage = function(event) {
            if (event.data == "back") {
              bc.close();
              history.back();
            }
          };
          bc.postMessage({event: "load", framesLength: frames.length });
        }
      });
    </script>
  </head>
  <body>
    This file posts a message containing "load" to opener or BroadcastChannel on load completion.
  </body>
</html>