webdetector/ts/webdetector.classes.pwa.ts

12 lines
294 B
TypeScript
Raw Permalink Normal View History

2023-06-11 14:09:06 +00:00
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;
}
}