summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/beacon/beacon-frame.html
blob: f50e04e90ad7d5aeffd92755d58044678944579c (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
<!DOCTYPE HTML>
<html>
<head>
  <title>Inner frame performing a basic sendBeacon from within an iframe</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
</head>
<body>
<script type="text/javascript">

function sendBeacon()
{
    var frame = window.parent.document.getElementById("frame");
    var data = window.parent.beaconConvert(frame.getAttribute("data"));

    var result = navigator.sendBeacon("http://mochi.test:8888/tests/dom/tests/mochitest/beacon/beacon-handler.sjs", data);
    window.parent.beaconSent(result);
}

window.addEventListener("load", function() { setTimeout(sendBeacon, 0); });

</script>
</body>
</html>