summaryrefslogtreecommitdiff
path: root/templates/layouts
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-05-03 20:43:46 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-05-03 20:43:46 +0200
commit709919a9624ed4336e9e5ae382e29cd34c795a82 (patch)
tree5562aa8a08048666c162db008db9b69dc554d4c6 /templates/layouts
parent9f3b80a859a8e54856dd283b635a4abfe377feb9 (diff)
Experimental PWA support (#13)
Diffstat (limited to 'templates/layouts')
-rw-r--r--templates/layouts/default.html.ep12
1 files changed, 12 insertions, 0 deletions
diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep
index a43d9f1..4877488 100644
--- a/templates/layouts/default.html.ep
+++ b/templates/layouts/default.html.ep
@@ -5,6 +5,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="#673ab7">
+ <link rel="manifest" href="/static/manifest.json">
% my $av = 'v10'; # asset version
%= stylesheet "/static/${av}/css/materialize.min.css"
%= stylesheet "/static/${av}/css/material-icons.css"
@@ -55,5 +56,16 @@
%= content
</div>
+<script>
+if ('serviceWorker' in navigator) {
+ window.addEventListener('load', () => {
+ navigator.serviceWorker.register('/service-worker.js')
+ .then((reg) => {
+ console.log('Service worker registered.', reg);
+ });
+ });
+}
+</script>
+
</body>
</html>