File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 5
5
self . addEventListener ( 'install' , function ( event ){
6
6
event . waitUntil (
7
7
caches . open ( 'test' ) . then ( function ( cache ) {
8
+ // NOTE: Only caching audio as offline support not necessary for test
8
9
return cache . addAll ( [ 'audio.mp3' , 'ranged_audio.mp3' ] )
10
+ } ) . then ( function ( ) {
11
+ return self . skipWaiting ( )
9
12
} )
10
- ) ;
11
- } ) ;
13
+ )
14
+ } )
15
+
16
+
17
+ self . addEventListener ( 'activate' , function ( event ) {
18
+ event . waitUntil ( self . clients . claim ( ) . then ( function ( ) {
19
+ console . log ( 'SW activated' )
20
+ } ) )
21
+ } )
12
22
13
23
14
24
self . addEventListener ( 'fetch' , function ( event ) {
@@ -21,8 +31,8 @@ self.addEventListener('fetch', function(event){
21
31
}
22
32
return fetch ( event . request )
23
33
} )
24
- ) ;
25
- } ) ;
34
+ )
35
+ } )
26
36
27
37
28
38
function rangeable_resp ( request , resp ) {
You can’t perform that action at this time.
0 commit comments