summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/beacon/beacon-frame.html
blob: 9dc4e4aab79fb2238d779f4d5f76b67376105d90 (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 type="text/javascript" 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); }, false);

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