-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
49 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,32 @@ | ||
{ | ||
"theme_color": "#213027", | ||
"theme_color": "#db5a5d", | ||
"start_url": "/im", | ||
"orientation": "any", | ||
"name": "MeroChat - Friendly Random Chat", | ||
"short_name": "MeroChat", | ||
"display": "standalone", | ||
"background_color": "#213027", | ||
"description": "Platonic only, karma based random chat", | ||
"description": "Platonic only, karma based, 1v1 random chat", | ||
"icons": [ | ||
{ | ||
"src": "/file/default/loading.png", | ||
"sizes": "46x46", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/file/default/logo.png", | ||
"sizes": "46x46", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/file/default/logo-3-small.png", | ||
"sizes": "33x33", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/file/default/logo-small.png", | ||
"sizes": "39x39", | ||
"type": "image/png" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
self.addEventListener('install', (e) => { | ||
e.waitUntil((async () => { | ||
// let cache = await caches.open(cacheName); | ||
importScripts('https://storage.googleapis.com/workbox-cdn/releases/6.4.1/workbox-sw.js'); | ||
|
||
// await cache.addAll(contentToCache); | ||
})()); | ||
}); | ||
let { registerRoute } = workbox.routing; | ||
let { CacheFirst } = workbox.strategies; | ||
let { CacheableResponsePlugin } = workbox.cacheableResponse; | ||
|
||
//cache pictures | ||
let imageRoute = | ||
new Route( | ||
({ request }) => request.destination === 'image', | ||
new CacheFirst({ | ||
cacheName: 'mero-pics', | ||
plugins: [ | ||
new CacheableResponsePlugin({ | ||
statuses: [200] | ||
}) | ||
]}) | ||
); | ||
|
||
registerRoute(imageRoute); | ||
|
||
self.addEventListener('install', _ => {}); | ||
|
||
//store chats and user data localy with indexeddb? | ||
//this would also require some sort of caching of the im page | ||
// and js/css scripts | ||
// and to enable multiple open sessions too | ||
//show push notifications | ||
//open links in external browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters