Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added client/public/image/mediatracker-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/public/image/mediatracker-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="manifest" href="/manifest.json">

<title>Media Tracker</title>

Expand All @@ -19,6 +20,16 @@
} else {
document.documentElement.classList.remove('dark');
}

if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js')
.then(function (reg) {
console.log('Service worker registered.', reg);
})
.catch(function (error) {
console.log('Service worker registration failed. Error: ', error);
});
}
</script>
</head>

Expand Down
20 changes: 20 additions & 0 deletions client/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "MediaTracker",
"short_name": "MediaTracker",
"start_url": "/",
"display": "standalone",
"background_color": "#404040",
"theme_color": "#262626",
"icons": [
{
"src": "/image/mediatracker-192x192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "/image/mediatracker-512x512.png",
"type": "image/png",
"sizes": "512x512"
}
]
}
11 changes: 11 additions & 0 deletions client/public/sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
self.addEventListener('install', function (_e) {
// Do nothing for now
});

self.addEventListener('activate', function (_e) {
// Do nothing for now
});

self.addEventListener('fetch', function (_e) {
// Do nothing for now
});
2 changes: 2 additions & 0 deletions client/webpack.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ const config: Configuration = {
patterns: [
{ from: 'public/logo', to: 'logo' },
{ from: 'public/image', to: 'image' },
{ from: 'public/manifest.json', to: 'manifest.json' },
{ from: 'public/sw.js', to: 'sw.js' },
],
}),
// new BundleAnalyzerPlugin(),
Expand Down