summaryrefslogtreecommitdiffstats
path: root/dom/serviceworkers/test/page_post_controlled.html
diff options
context:
space:
mode:
Diffstat (limited to 'dom/serviceworkers/test/page_post_controlled.html')
-rw-r--r--dom/serviceworkers/test/page_post_controlled.html27
1 files changed, 27 insertions, 0 deletions
diff --git a/dom/serviceworkers/test/page_post_controlled.html b/dom/serviceworkers/test/page_post_controlled.html
new file mode 100644
index 0000000000..27694c0027
--- /dev/null
+++ b/dom/serviceworkers/test/page_post_controlled.html
@@ -0,0 +1,27 @@
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="utf-8">
+</head>
+<body>
+<script type="text/javascript">
+ window.parent.postMessage({
+ controlled: !!navigator.serviceWorker.controller
+ }, "*");
+
+ addEventListener("message", e => {
+ if (e.data == "create nested iframe") {
+ const iframe = document.createElement('iframe');
+ document.body.appendChild(iframe);
+ iframe.src = location.href;
+ } else {
+ window.parent.postMessage(e.data, "*");
+ }
+ });
+</script>
+</body>
+</html>