blob: 88dc00aff00a40ad6193c0148cd0e65066d83423 (
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
28
29
30
31
32
|
<!-- 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;
const registerServiceWorker = async function() {
try {
registration = await navigator.serviceWorker.register("empty-sw.js");
dump("Empty service worker registered\n");
} catch (e) {
dump("Empty service worker not registered: " + e + "\n");
}
};
// Helper called from head.js to unregister the service worker.
window.getRegistration = function() {
return registration;
};
// Register the service worker.
registerServiceWorker();
</script>
</body>
</html>
|