Compare commits

...

2 Commits

Author SHA1 Message Date
schlagmichdoch 8a56a271bc Make PWA run standalone (fixes #264) 2024-02-23 13:02:40 +01:00
schlagmichdoch 07e46e472e Prevent flickering of text on load by adding defer="true" to deferred style sheets 2024-02-22 15:30:09 +01:00
2 changed files with 3 additions and 2 deletions

View File

@ -28,7 +28,7 @@
"background_color": "#efefef",
"start_url": "/",
"scope": "/",
"display": "minimal-ui",
"display": "standalone",
"theme_color": "#3367d6",
"screenshots" : [
{

View File

@ -101,7 +101,7 @@ class PairDrop {
}
onPwaInstallable(e) {
if (!window.matchMedia('(display-mode: minimal-ui)').matches) {
if (!window.matchMedia('(display-mode: standalone)').matches) {
// only display install btn when not installed
this.$headerInstallBtn.removeAttribute('hidden');
this.$headerInstallBtn.addEventListener('click', () => {
@ -137,6 +137,7 @@ class PairDrop {
let stylesheet = document.createElement('link');
stylesheet.rel = 'preload';
stylesheet.as = 'style';
stylesheet.defer = true;
stylesheet.href = url;
stylesheet.onload = _ => {
stylesheet.onload = null;