diff --git a/src/background.js b/src/background.js index 939da6a..ae0f8e9 100644 --- a/src/background.js +++ b/src/background.js @@ -4,12 +4,13 @@ function createNotification(title, message = '', sticky = false, timeout) { const notificationContent = { type: 'basic', iconUrl: 'logo.png', - title, message, - requireInteraction: typeof InstallTrigger === 'undefined' - ? sticky - : false + title, message }; + if (typeof InstallTrigger === 'undefined') { + notificationContent.requireInteraction = sticky; + } + const id = `notification_${Date.now()}`; browser.notifications.create(id, notificationContent);