diff --git a/layouts/notifications/script.js b/layouts/notifications/script.js index de88f123..81c0b921 100644 --- a/layouts/notifications/script.js +++ b/layouts/notifications/script.js @@ -66,14 +66,16 @@ async function updateNotifications(options = { mode: 'rewrite', quiet: false }) API.notifications.markAsRead(cursorTop); if(windowFocused) { chrome.storage.local.remove(['unreadCount'], () => {}); - document.getElementById('site-icon').href = chrome.runtime.getURL(`images/logo32${vars.useNewIcon ? '_new' : ''}_notification.png`); - let newTitle = document.title; - if(document.title.startsWith('(')) { - newTitle = document.title.split(') ')[1]; - } - newTitle = `(${data.unreadNotifications}) ${newTitle}`; - if(document.title !== newTitle) { - document.title = newTitle; + if (data.unreadNotifications > 0) { + document.getElementById('site-icon').href = chrome.runtime.getURL(`images/logo32${vars.useNewIcon ? '_new' : ''}_notification.png`); + let newTitle = document.title; + if(document.title.startsWith('(')) { + newTitle = document.title.split(') ')[1]; + } + newTitle = `(${data.unreadNotifications}) ${newTitle}`; + if(document.title !== newTitle) { + document.title = newTitle; + } } notificationBus.postMessage({type: 'markAsRead', cursor: cursorTop}); } diff --git a/scripts/iframeNavigation.js b/scripts/iframeNavigation.js index f852399a..a9a6a09b 100644 --- a/scripts/iframeNavigation.js +++ b/scripts/iframeNavigation.js @@ -34,7 +34,7 @@ if(!window.top.windows && window.top === window) { } if(!window.top.windows.includes(window)) window.top.windows.push(window); if(!window._realPath) window._realPath = location.pathname; -if(window.top !== window) { +if(window.top !== window && location.protocol == 'https:') { setTimeout(() => { window.top.document.title = document.title; }, 1000);