@@ -197,6 +197,7 @@ const hoverCardsToggle = document.getElementById("hover-cards-toggle");
197197
198198// Desktop notification settings
199199const desktopNotificationsToggle = document . getElementById ( "desktop-notifications-toggle" ) ;
200+ const desktopNotificationsHint = document . getElementById ( "desktop-notifications-hint" ) ;
200201
201202let scrollbarCompensationRaf = null ;
202203
@@ -440,9 +441,18 @@ async function showSettings() {
440441 desktopNotificationsToggle . disabled = true ;
441442 desktopNotificationsToggle . parentElement . title =
442443 "Browser notification permission denied. Please enable it in browser settings." ;
444+ if ( desktopNotificationsHint ) {
445+ desktopNotificationsHint . textContent =
446+ "Permission denied. Please enable notifications in browser settings." ;
447+ desktopNotificationsHint . hidden = false ;
448+ }
443449 } else if ( permission === "unsupported" ) {
444450 desktopNotificationsToggle . disabled = true ;
445451 desktopNotificationsToggle . parentElement . title = "Browser notifications not supported." ;
452+ if ( desktopNotificationsHint ) {
453+ desktopNotificationsHint . textContent = "Browser notifications are not supported." ;
454+ desktopNotificationsHint . hidden = false ;
455+ }
446456 }
447457 // Hide header and footer
448458 document . querySelector ( ".header" ) . hidden = true ;
@@ -1011,6 +1021,8 @@ hoverCardsToggle.addEventListener("change", async () => {
10111021desktopNotificationsToggle . addEventListener ( "change" , async ( ) => {
10121022 const enabled = desktopNotificationsToggle . checked ;
10131023
1024+ if ( desktopNotificationsHint ) desktopNotificationsHint . hidden = true ;
1025+
10141026 if ( enabled ) {
10151027 // Check current permission
10161028 let permission = checkNotificationPermission ( ) ;
@@ -1028,12 +1040,14 @@ desktopNotificationsToggle.addEventListener("change", async () => {
10281040 desktopNotificationsToggle . checked = false ;
10291041 await storage . setEnableDesktopNotifications ( false ) ;
10301042
1031- if ( permission === "denied" ) {
1032- alert (
1033- "Browser notification permission was denied. Please enable it in your browser settings to use desktop notifications." ,
1034- ) ;
1035- } else if ( permission === "unsupported" ) {
1036- alert ( "Browser notifications are not supported in this browser." ) ;
1043+ if ( desktopNotificationsHint ) {
1044+ if ( permission === "denied" ) {
1045+ desktopNotificationsHint . textContent =
1046+ "Permission denied. Please enable notifications in browser settings." ;
1047+ } else if ( permission === "unsupported" ) {
1048+ desktopNotificationsHint . textContent = "Browser notifications are not supported." ;
1049+ }
1050+ desktopNotificationsHint . hidden = false ;
10371051 }
10381052 }
10391053 } else {
0 commit comments