Skip to content

Instantly share code, notes, and snippets.

@dmnsgn
Last active April 26, 2018 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmnsgn/3654817fc08ae1c145fd149565785b42 to your computer and use it in GitHub Desktop.
Save dmnsgn/3654817fc08ae1c145fd149565785b42 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>ES modules in the browser - almost - now | Service worker</title>
</head>
<body>
<script>
// Register
navigator.serviceWorker
.register("sw.js")
.then(() => console.log("Service Worker registered"))
.catch(err => console.err(err));
</script>
<script type="module" src="app.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment