webdetector/ts/webdetector.classes.pwa.ts
2023-06-11 16:09:06 +02:00

12 lines
294 B
TypeScript

export class Pwa {
public isInstalled(): boolean {
let isInstalled: boolean;
if (globalThis?.matchMedia?.('(display-mode: standalone)').matches) {
isInstalled = true;
console.log('PWA installed');
} else {
isInstalled = false;
}
return isInstalled;
}
}