summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fetch/api/resources/keepalive-iframe.html
blob: ac00f3a331a1453265ef1825d9cc84a38565d2c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!doctype html>
<html>
<meta charset="utf-8">
<script>
const SEARCH_PARAMS = new URL(location.href).searchParams;
const TOKEN = SEARCH_PARAMS.get('token') || '';
const METHOD = SEARCH_PARAMS.get('method') || 'GET';
const url = `/fetch/api/resources/stash-put.py?key=${TOKEN}&value=on`;

addEventListener('load', () => {
  let p = fetch(url, {keepalive: true, method: METHOD});
  window.parent.postMessage(TOKEN, '*');
});
</script>
</html>