Skip to content

Instantly share code, notes, and snippets.

@neocris
Last active July 15, 2020 15:21
Show Gist options
  • Save neocris/fb05a9488913dabd249e72e1b0528117 to your computer and use it in GitHub Desktop.
Save neocris/fb05a9488913dabd249e72e1b0528117 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>App Shell</title>
<link rel="manifest" href="/manifest.json">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="styles/inline.css">
</head>
<body>
<header class="header">
<h1 class="header__title">App Shell</h1>
</header>
<nav class="nav">
...
</nav>
<main class="main">
...
</main>
<div class="dialog-container">
...
</div>
<div class="loader">
<!-- Show a spinner or placeholders for content -->
</div>
<script src="app.js" async></script>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js').then(function(registration) {
// Registration was successful
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}).catch(function(err) {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment