| 
									
										
										
										
											2020-04-18 23:01:52 -06:00
										 |  |  | /* | 
					
						
							| 
									
										
										
										
											2020-01-07 21:51:03 -07:00
										 |  |  |  * This Source Code Form is subject to the terms of the Mozilla Public | 
					
						
							|  |  |  |  * License, v. 2.0. If a copy of the MPL was not distributed with this | 
					
						
							|  |  |  |  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-25 22:02:56 -06:00
										 |  |  | var cachename = "v1.5.1_0"; | 
					
						
							| 
									
										
										
										
											2020-01-08 02:58:24 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-18 23:01:52 -06:00
										 |  |  | //self.addEventListener('fetch', (event) => {
 | 
					
						
							|  |  |  | //    event.respondWith(
 | 
					
						
							|  |  |  | //            caches.match(event.request).then((resp) => {
 | 
					
						
							|  |  |  | //        return resp || fetch(event.request).then((response) => {
 | 
					
						
							|  |  |  | //            return caches.open(cachename).then((cache) => {
 | 
					
						
							|  |  |  | //                try {
 | 
					
						
							|  |  |  | //                    // only cache map data
 | 
					
						
							|  |  |  | //                    if (event.request.url.includes("maps.netsyms.net")) {
 | 
					
						
							|  |  |  | //                        cache.put(event.request, response.clone());
 | 
					
						
							|  |  |  | //                    }
 | 
					
						
							|  |  |  | //                } catch (ex) {
 | 
					
						
							| 
									
										
										
										
											2020-01-08 14:58:34 -07:00
										 |  |  | //
 | 
					
						
							| 
									
										
										
										
											2020-04-18 23:01:52 -06:00
										 |  |  | //                }
 | 
					
						
							|  |  |  | //                return response;
 | 
					
						
							|  |  |  | //            });
 | 
					
						
							|  |  |  | //        });
 | 
					
						
							|  |  |  | //    })
 | 
					
						
							|  |  |  | //            );
 | 
					
						
							|  |  |  | //});
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-08 14:58:34 -07:00
										 |  |  | //self.addEventListener('install', function (event) {
 | 
					
						
							|  |  |  | //    event.waitUntil(
 | 
					
						
							|  |  |  | //            caches.open(cachename).then((cache) => {
 | 
					
						
							|  |  |  | //        return cache.addAll([
 | 
					
						
							|  |  |  | //            "https://maps.netsyms.net/styles/osm-liberty/style.json",
 | 
					
						
							|  |  |  | //            "https://maps.netsyms.net/styles/klokantech-terrain/style.json",
 | 
					
						
							|  |  |  | //            "https://maps.netsyms.net/styles/fiord-color/style.json",
 | 
					
						
							|  |  |  | //            "https://maps.netsyms.net/styles/oled-black/style.json"
 | 
					
						
							|  |  |  | //        ]);
 | 
					
						
							|  |  |  | //    }));
 | 
					
						
							|  |  |  | //});
 |