diff options
Diffstat (limited to '')
-rw-r--r-- | testing/web-platform/tests/presentation-api/receiving-ua/support/iframe.html | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testing/web-platform/tests/presentation-api/receiving-ua/support/iframe.html b/testing/web-platform/tests/presentation-api/receiving-ua/support/iframe.html new file mode 100644 index 0000000000..61f18b8912 --- /dev/null +++ b/testing/web-platform/tests/presentation-api/receiving-ua/support/iframe.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Helper functions invoked by a nested browsing context</title> +<link rel="author" title="Tomoyuki Shimizu" href="https://github.com/tomoyukilabs"> +<link rel="help" href="https://w3c.github.io/presentation-api/#monitoring-incoming-presentation-connections"> + +<script> + window.addEventListener('message', event => { + const data = event.data; + + if (!data.type) + return; + else if (data.type === 'connect') { + const request = new PresentationRequest(data.url); + request.reconnect(data.id).then(c => { + c.onterminate = () => { + window.parent.postMessage({ type: 'terminated' }, '*'); + }; + }); + } + }); +</script>
\ No newline at end of file |