From edbaa5609e98c824050b75321fc03f406cc71dba Mon Sep 17 00:00:00 2001 From: Steve Richter Date: Mon, 28 Dec 2020 14:44:44 -0500 Subject: [PATCH] Check for window.isSecureContext when determining Notification support --- ui/src/i18n/en.json | 2 +- ui/src/personal/Personal.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json index 422b59e13..559cc457f 100644 --- a/ui/src/i18n/en.json +++ b/ui/src/i18n/en.json @@ -265,7 +265,7 @@ "delete_user_title": "Delete user '%{name}'", "delete_user_content": "Are you sure you want to delete this user and all their data (including playlists and preferences)?", "notifications_blocked": "You have blocked Notifications for this site in your browser's settings", - "notifications_not_available": "This browser does not support desktop notifications" + "notifications_not_available": "This browser does not support desktop notifications or you are not accessing Navidrome over https" }, "menu": { "library": "Library", diff --git a/ui/src/personal/Personal.js b/ui/src/personal/Personal.js index 242d02f06..44ae50d18 100644 --- a/ui/src/personal/Personal.js +++ b/ui/src/personal/Personal.js @@ -131,7 +131,7 @@ const NotificationsToggle = () => { const dispatch = useDispatch() const notify = useNotify() const currentSetting = useSelector((state) => state.settings.notifications) - const notAvailable = !('Notification' in window) + const notAvailable = !('Notification' in window) || !window.isSecureContext if ( (currentSetting && Notification.permission !== 'granted') ||