From 824a30c8eb90d0bbb44ec97926a69afc21328cbd Mon Sep 17 00:00:00 2001 From: tomayac Date: Wed, 18 Dec 2019 11:28:39 +0100 Subject: [PATCH 1/3] Conditionally include PWACompat Fixes #275 --- src/_js/main.mjs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/_js/main.mjs b/src/_js/main.mjs index d31a29221..788757f0b 100644 --- a/src/_js/main.mjs +++ b/src/_js/main.mjs @@ -107,3 +107,10 @@ ga('send', 'pageview'); const gaScript = document.createElement('script'); gaScript.src = 'https://www.google-analytics.com/analytics.js'; document.head.appendChild(gaScript); + +// On Apple mobile devices add the proprietary app icon and splashscreen markup. +// No one should have to do this manually, and eventually this annoyance will +// go away once https://bugs.webkit.org/show_bug.cgi?id=183937 is fixed. +if (/\b(iPad|iPhone|iPod)\b/.test(navigator.userAgent)) { + import('https://unpkg.com/pwacompat'); +} From b6e530fa39e40714d93178ef30cfb49640c726db Mon Sep 17 00:00:00 2001 From: Thomas Steiner Date: Wed, 27 May 2020 14:57:10 +0200 Subject: [PATCH 2/3] Improve lazy-loading conditions --- src/_js/main.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_js/main.mjs b/src/_js/main.mjs index 788757f0b..ed4006914 100644 --- a/src/_js/main.mjs +++ b/src/_js/main.mjs @@ -111,6 +111,7 @@ document.head.appendChild(gaScript); // On Apple mobile devices add the proprietary app icon and splashscreen markup. // No one should have to do this manually, and eventually this annoyance will // go away once https://bugs.webkit.org/show_bug.cgi?id=183937 is fixed. -if (/\b(iPad|iPhone|iPod)\b/.test(navigator.userAgent)) { +if ((/\b(iPad|iPhone|iPod)\b/.test(navigator.userAgent)) && + (!matchMedia('(display-mode: standalone)').matches)) { import('https://unpkg.com/pwacompat'); } From 2257f6816433aaa7aab8fa4cd1d1e0755a6ceb80 Mon Sep 17 00:00:00 2001 From: Thomas Steiner Date: Tue, 2 Jun 2020 12:16:02 +0200 Subject: [PATCH 3/3] Remove standalone check --- src/_js/main.mjs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/_js/main.mjs b/src/_js/main.mjs index ed4006914..788757f0b 100644 --- a/src/_js/main.mjs +++ b/src/_js/main.mjs @@ -111,7 +111,6 @@ document.head.appendChild(gaScript); // On Apple mobile devices add the proprietary app icon and splashscreen markup. // No one should have to do this manually, and eventually this annoyance will // go away once https://bugs.webkit.org/show_bug.cgi?id=183937 is fixed. -if ((/\b(iPad|iPhone|iPod)\b/.test(navigator.userAgent)) && - (!matchMedia('(display-mode: standalone)').matches)) { +if (/\b(iPad|iPhone|iPod)\b/.test(navigator.userAgent)) { import('https://unpkg.com/pwacompat'); }