aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2016-09-30 17:56:23 +0200
committerNoah Loomans <noahloomans@gmail.com>2016-09-30 17:56:23 +0200
commite61d32f93511833efef972a50a7fd7a9b4eec78d (patch)
treeb1bdbfd2359b246974a726ebd802a64ebfe84dab /views
parentae1f968de09f7952b5b4bad369255a0a60cb81b8 (diff)
add offline support
Diffstat (limited to 'views')
-rw-r--r--views/index.jade10
1 files changed, 10 insertions, 0 deletions
diff --git a/views/index.jade b/views/index.jade
index b4db649..c219d94 100644
--- a/views/index.jade
+++ b/views/index.jade
@@ -30,3 +30,13 @@ block content
iframe(src='/hello', scrolling='no')#schedule
script(src='/javascripts/bundle.js')
+ 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)
+ })
+ }