aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
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)
+ })
+ }