Source code
Revision control
Copy as Markdown
Other Tools
<!-- Any copyright is dedicated to the Public Domain.
<!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>