Add geotagging and location map v0.4
This commit is contained in:
1 parent
cbf0daf062
commit
e290bd1fff
12 files changed
+578
-45
No files matched your search
@@ -1,5 +1,5 @@
|
||||
const CACHE_NAME = 'photo-date-editor-v3';
|
||||
const SHELL = ['/', '/styles.css', '/app.js', '/manifest.webmanifest'];
|
||||
const CACHE_NAME = 'photo-date-editor-v4';
|
||||
const SHELL = ['/', '/styles.css', '/app.js', '/manifest.webmanifest', '/vendor/leaflet/leaflet.css', '/vendor/leaflet/leaflet.js'];
|
||||
|
||||
self.addEventListener('install', (event) => {
|
||||
event.waitUntil(caches.open(CACHE_NAME).then((cache) => cache.addAll(SHELL)));
|
||||
@@ -14,7 +14,13 @@ self.addEventListener('activate', (event) => {
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', (event) => {
|
||||
if (event.request.method !== 'GET' || new URL(event.request.url).pathname.startsWith('/api/')) return;
|
||||
const url = new URL(event.request.url);
|
||||
if (
|
||||
event.request.method !== 'GET'
|
||||
|| url.origin !== self.location.origin
|
||||
|| url.pathname.startsWith('/api/')
|
||||
) return;
|
||||
|
||||
event.respondWith(
|
||||
fetch(event.request).then((response) => {
|
||||
const copy = response.clone();
|
||||
|
||||
Reference in new issue
Block a user