Skip to content

Commit

Permalink
js: Don't crash UI in case of non-https connections
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Jul 18, 2024
1 parent 1eeb808 commit f55b0e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions public/js/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ const VERSION = 1;
return;
}

if (! navigator.serviceWorker) {
console.error(LOG_PREFIX + "this browser does not support the 'Service Worker API' in the current context");

return;
}

if (! 'Notification' in self) {
console.error(LOG_PREFIX + "this browser does not support the 'Notification API' in the current context");

Expand Down

0 comments on commit f55b0e2

Please sign in to comment.