diff --git a/Dockerfile-build b/Dockerfile-build index 62a60bd8..6e96c7d4 100644 --- a/Dockerfile-build +++ b/Dockerfile-build @@ -2,13 +2,17 @@ FROM golang:1.20-bullseye as builder ARG VERSION=dev ARG COMMIT=unknown +ARG NODE_MAJOR=18 -RUN apt-get update -RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -RUN apt-get install -y \ - build-essential \ - nodejs \ - python3-pip +RUN apt-get update && apt-get install -y \ + build-essential ca-certificates curl gnupg \ + && mkdir -p /etc/apt/keyrings \ + && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ + && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" >> /etc/apt/sources.list.d/nodesource.list \ + && apt-get update \ + && apt-get install -y \ + python3-pip nodejs \ + && rm -rf /var/lib/apt/lists/* WORKDIR /app ADD Makefile . diff --git a/docs/static/img/pwa-install-macos-safari-add-to-dock.png b/docs/static/img/pwa-install-macos-safari-add-to-dock.png new file mode 100644 index 00000000..8a780605 Binary files /dev/null and b/docs/static/img/pwa-install-macos-safari-add-to-dock.png differ diff --git a/docs/subscribe/pwa.md b/docs/subscribe/pwa.md index 582cb5ae..5dcaa257 100644 --- a/docs/subscribe/pwa.md +++ b/docs/subscribe/pwa.md @@ -26,6 +26,13 @@ app drawer: +### Safari on macOS +To install and register the web app via Safari, click on the Share menu and click Add to Dock. You need to be on macOS Sonoma (14) or higher. + +
+ +
+ ### Chrome/Firefox on Android For Chrome on Android, either click the "Add to Home Screen" banner at the bottom of the screen, or select "Install app" in the menu, and then click "Install" in the popup menu. After installation, you can find the app in your app drawer, diff --git a/web/src/app/Notifier.js b/web/src/app/Notifier.js index 4089746a..77bbdb1e 100644 --- a/web/src/app/Notifier.js +++ b/web/src/app/Notifier.js @@ -124,9 +124,17 @@ class Notifier { return window.location.protocol === "https:" || window.location.hostname.match("^127.") || window.location.hostname === "localhost"; } + // no PushManager when not installed, but it _is_ supported. iosSupportedButInstallRequired() { - // no PushManager when not installed, but it _is_ supported. - return config.enable_web_push && "serviceWorker" in navigator && window.navigator.standalone === false; + return ( + config.enable_web_push && + // a service worker exists + "serviceWorker" in navigator && + // but the pushmanager API is missing, which implies we're on an iOS device without installing + !("PushManager" in window) && + // check that this is the case by checking for `standalone`, which only exists on Safari + window.navigator.standalone === false + ); } }