service_worker_client.html 678 B

1234567891011121314151617181920212223242526272829
  1. <!--
  2. Any copyright is dedicated to the Public Domain.
  3. http://creativecommons.org/publicdomain/zero/1.0/
  4. -->
  5. <!DOCTYPE HTML>
  6. <html>
  7. <head>
  8. <title>controlled page</title>
  9. <script class="testbody" type="text/javascript">
  10. if (!parent) {
  11. info("service_worker_client.html should not be launched directly!");
  12. }
  13. window.onload = function() {
  14. navigator.serviceWorker.onmessage = function(msg) {
  15. // Forward messages coming from the service worker to the test page.
  16. parent.postMessage(msg.data, "*");
  17. };
  18. navigator.serviceWorker.ready.then(function(swr) {
  19. parent.postMessage("READY", "*");
  20. });
  21. }
  22. </script>
  23. </head>
  24. <body>
  25. </body>
  26. </html>