File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11CACHE MANIFEST
2- # Build: 20170522081657
2+ # Build: 20170522082001
33
44CACHE:
55resources/fonts/Dressedless_Three.svg
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ gulp.task("dist:appjs", function() {
9191gulp . task ( "dist:swjs" , function ( ) {
9292 return gulp . src ( [ './static/app/src/sw.js' ] )
9393 . pipe ( cachebust . references ( ) )
94- . pipe ( gulp . dest ( './src/ ' ) ) ;
94+ . pipe ( gulp . dest ( './' ) ) ;
9595} ) ;
9696gulp . task ( 'dist:html' , function ( ) {
9797 return gulp . src ( [ './static/app/*.html' ] )
Load diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1212< script >
1313 if ( 'serviceWorker' in navigator ) {
1414 window . addEventListener ( 'load' , function ( ) {
15- navigator . serviceWorker . register ( 'src/sw.js' , {
16- scope : '/codelf-sw/'
17- } ) . then ( function ( registration ) {
15+ navigator . serviceWorker . register ( 'sw.js' ) . then ( function ( registration ) {
1816 // Registration was successful
1917 console . log ( 'ServiceWorker registration successful with scope: ' , registration . scope ) ;
2018 } , function ( err ) {
Original file line number Diff line number Diff line change 1+ // Here comes the install event!
2+ // This only happens once, when the browser sees this
3+ // version of the ServiceWorker for the first time.
4+ self . addEventListener ( 'install' , function ( event ) {
5+ // We pass a promise to event.waitUntil to signal how
6+ // long install takes, and if it failed
7+ event . waitUntil (
8+ // We open a cache…
9+ caches . open ( 'simple-sw-v1' ) . then ( function ( cache ) {
10+ // And add resources to it
11+ return cache . addAll ( [
12+ 'src/lib/all.207da233.js'
13+ ] ) ;
14+ } )
15+ ) ;
16+ } ) ;
17+
18+ // The fetch event happens for the page request with the
19+ // ServiceWorker's scope, and any request made within that
20+ // page
21+ self . addEventListener ( 'fetch' , function ( event ) {
22+ // Calling event.respondWith means we're in charge
23+ // of providing the response. We pass in a promise
24+ // that resolves with a response object
25+ event . respondWith (
26+ // First we look for something in the caches that
27+ // matches the request
28+ caches . match ( event . request ) . then ( function ( response ) {
29+ // If we get something, we return it, otherwise
30+ // it's null, and we'll pass the request to
31+ // fetch, which will use the network.
32+ return response || fetch ( event . request ) ;
33+ } )
34+ ) ;
35+ } ) ;
You can’t perform that action at this time.
0 commit comments