summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/client-hints/resources/accept-ch.wildcard.iframe.https.sub.html
blob: 250a9d9e2247db9c9d8bd65e11141ff2e4ff5087 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!doctype html>
<meta charset="utf-8">
<script>
// Step 2 (client-hints/accept-ch.wildcard.https.sub.html)
const xhr = new XMLHttpRequest();
xhr.open('POST', "https://{{domains[www2]}}:{{ports[https][0]}}/client-hints/resources/echo-ua-client-hints-received.py");
xhr.onload = function() {
    // Step 3 (client-hints/accept-ch.wildcard.https.sub.html)
    if (xhr.getResponseHeader("sec-ch-ua-platform-received") != null) {
        window.top.postMessage("HadPlatformVersion", "*");
    } else {
        window.top.postMessage("MissingPlatformVersion", "*");
    }
};
xhr.send();
</script>