Lägger till service worker och uppdaterar manifest.json för att stödja PWA
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/service-worker.js')
|
||||
.then(registration => {
|
||||
console.log('ServiceWorker registration successful with scope: ', registration.scope);
|
||||
})
|
||||
.catch(error => {
|
||||
console.log('ServiceWorker registration failed: ', error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById('taskForm').addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "Task Manager",
|
||||
"short_name": "TaskApp",
|
||||
"description": "An app to manage tasks in Org mode format.",
|
||||
"name": "Fredriks todos",
|
||||
"short_name": "TODO",
|
||||
"description": "Fredriks app to manage tasks in Org mode format.",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#ffffff",
|
||||
|
||||
Reference in New Issue
Block a user