Compare commits
No commits in common. "b5f6c5bb90afde481d97dc9581217b11e3794cbd" and "f4f93fbfde49a50b3d04d28145828d76b5ed0960" have entirely different histories.
b5f6c5bb90
...
f4f93fbfde
BIN
img/192.png
BIN
img/192.png
Binary file not shown.
Before Width: | Height: | Size: 40 KiB |
BIN
img/icon.png
BIN
img/icon.png
Binary file not shown.
Before Width: | Height: | Size: 59 KiB |
|
@ -5,8 +5,6 @@
|
|||
<meta name="author" content="Xaloc">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<link rel="manifest" href="manifest.json">
|
||||
<link rel="apple-touch-icon" href="img/icon.png"/>
|
||||
<title>Currency Converter</title>
|
||||
</head>
|
||||
|
||||
|
@ -55,12 +53,5 @@
|
|||
</div>
|
||||
</div>
|
||||
<script src='script.js'></script>
|
||||
<script>
|
||||
if('serviceWorker' in navigator){
|
||||
navigator.serviceWorker.register('/service-worker.js');
|
||||
} else {
|
||||
console.log("Service worker is not supported");
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
{
|
||||
"name": "Currency Converter",
|
||||
"short_name": "Currency Converter",
|
||||
"start_url": "/",
|
||||
"background_color": "#55335C",
|
||||
"theme_color": "#9E79C0",
|
||||
"icons": [
|
||||
{
|
||||
"src": "img/icon.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable any"
|
||||
},
|
||||
{
|
||||
"src": "img/192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable any"
|
||||
}
|
||||
],
|
||||
"display": "standalone",
|
||||
"orientation":"portrait"
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
const CACHE_NAME = 'Convert-currency';
|
||||
|
||||
let resourcesToCache = ["./", "./bg.jpg", "./script.js", "./style.css"];
|
||||
|
||||
self.addEventListener("install", e=>{
|
||||
e.waitUntil(
|
||||
caches.open(CACHE_NAME).then(cache =>{
|
||||
return cache.addAll(resourcesToCache);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
// Cache and return requests
|
||||
self.addEventListener("fetch", e=>{
|
||||
e.respondWith(
|
||||
caches.match(e.request).then(response=>{
|
||||
return response || fetch(e.request);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
// Update a service worker
|
||||
const cacheWhitelist = ['Convert-currency'];
|
||||
self.addEventListener('activate', event => {
|
||||
event.waitUntil(
|
||||
caches.keys().then(cacheNames => {
|
||||
return Promise.all(
|
||||
cacheNames.map(cacheName => {
|
||||
if (cacheWhitelist.indexOf(cacheName) === -1) {
|
||||
return caches.delete(cacheName);
|
||||
}
|
||||
})
|
||||
);
|
||||
})
|
||||
);
|
||||
});
|
Loading…
Reference in New Issue
Block a user