summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/performance-timeline/resources/parent-frame-with-same-origin-child.html
blob: c9248a4e8bb9f4107be82947436e469c3c74aaa6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE html>
<head></head>
<body></body>
<script>
    // Create child frame that is same-origin with its parent.
    const childFrame = document.createElement('iframe')
    childFrame.src = "child-frame.html"
    document.body.appendChild(childFrame)

    performance.mark("entry-name")

    childFrame.addEventListener('load', () => {
        const entries = performance.getEntries(true)
        window.parent.postMessage(entries.length, "*")
    })
</script>