feat: add pwa support

This commit is contained in:
4gray committed 2022-01-03 21:45:09 +01:00
1 parent db0df76e53
commit 5a5085dcf7
14 files changed
+275 -263

No files matched your search

+7
View File
@@ -20,6 +20,7 @@ import { DataService } from './services/data.service';
import { NgxIndexedDBModule, NgxIndexedDBService } from 'ngx-indexed-db';
import { AppConfig } from '../environments/environment';
import { dbConfig } from './indexed-db.config';
import { ServiceWorkerModule } from '@angular/service-worker';
// AoT requires an exported function for factories
export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
@@ -65,6 +66,12 @@ export function DataFactory(dbService: NgxIndexedDBService, http: HttpClient) {
deps: [HttpClient],
},
}),
ServiceWorkerModule.register('ngsw-worker.js', {
enabled: AppConfig.production,
// Register the ServiceWorker as soon as the app is stable
// or after 30 seconds (whichever comes first).
registrationStrategy: 'registerWhenStable:30000',
}),
],
providers: [
{
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

+2
View File
@@ -6,6 +6,8 @@
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="manifest" href="manifest.webmanifest">
<link rel="apple-touch-icon" href="assets/icons/apple-touch-icon.png"/>
<link rel="icon" type="image/x-icon" href="assets/icons/favicon.ico" />
<script>
if (global === undefined) {
+34
View File
@@ -0,0 +1,34 @@
{
"name": "iptvnator",
"description": "IPTVnator is a tool to watch and manage your IPTV playlists.",
"short_name": "iptvnator",
"theme_color": "#000",
"background_color": "#fafafa",
"display": "standalone",
"scope": "./",
"start_url": "./",
"icons": [
{
"src": "assets/icons/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "assets/icons/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "assets/icons/android-chrome-maskable-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "assets/icons/android-chrome-maskable-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
]
}