OLD | NEW |
1 self.addEventListener('install', function(event) { | 1 self.addEventListener('install', function(event) { |
2 var params = JSON.parse(decodeURIComponent(location.search.substring(1))); | 2 var params = JSON.parse(decodeURIComponent(location.search.substring(1))); |
3 if (!('scopes' in params)) { | 3 if (!('scopes' in params)) { |
4 if ('relscopes' in params) { | 4 if ('relscopes' in params) { |
5 params.scopes = params.relscopes.map(s => registration.scope + s); | 5 params.scopes = params.relscopes.map(s => registration.scope + s); |
6 } else { | 6 } else { |
7 params.scopes = [registration.scope]; | 7 params.scopes = [registration.scope]; |
8 } | 8 } |
9 } | 9 } |
10 if (!('origins' in params)) | 10 if (!('origins' in params)) |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 69 } |
70 } | 70 } |
71 | 71 |
72 if (handler) { | 72 if (handler) { |
73 handler.fn(event); | 73 handler.fn(event); |
74 } else { | 74 } else { |
75 event.respondWith({origin: event.origin, | 75 event.respondWith({origin: event.origin, |
76 response: new Response('unexpected request')}); | 76 response: new Response('unexpected request')}); |
77 } | 77 } |
78 }); | 78 }); |
OLD | NEW |