summaryrefslogtreecommitdiffstats
path: root/devtools/client/application/test/browser/resources/service-workers/controlled-install.html
blob: 300ee1fde721903ddd0dcc03f0e05e11dc43d9c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!-- Any copyright is dedicated to the Public Domain.
     http://creativecommons.org/publicdomain/zero/1.0/ -->
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="UTF-8">
  <title>Service worker test</title>
</head>
<body>
<script type="text/javascript">
"use strict";

let registration;

window.registerServiceWorker = async function() {
  registration = await navigator.serviceWorker.register(
    "controlled-install-sw.js"
  );
  window.sw = registration;
};

window.installServiceWorker = function() {
  registration.installing.postMessage("install-service-worker");
};
</script>
</body>
</html>