Index: lib/notificationHelper.js |
=================================================================== |
--- a/lib/notificationHelper.js |
+++ b/lib/notificationHelper.js |
@@ -52,21 +52,21 @@ |
function getNotificationButtons(notificationType, message) |
{ |
let buttons = []; |
if (notificationType == "question") |
{ |
buttons.push({ |
type: "question", |
- title: ext.i18n.getMessage("overlay_notification_button_yes") |
+ title: chrome.i18n.getMessage("overlay_notification_button_yes") |
}); |
buttons.push({ |
type: "question", |
- title: ext.i18n.getMessage("overlay_notification_button_no") |
+ title: chrome.i18n.getMessage("overlay_notification_button_no") |
}); |
} |
else |
{ |
let regex = /<a>(.*?)<\/a>/g; |
let match; |
while (match = regex.exec(message)) |
{ |
@@ -79,25 +79,25 @@ |
// Chrome only allows two notification buttons so we need to fall back |
// to a single button to open all links if there are more than two. |
let maxButtons = (notificationType == "critical") ? 2 : 1; |
if (buttons.length > maxButtons) |
{ |
buttons = [ |
{ |
type: "open-all", |
- title: ext.i18n.getMessage("notification_open_all") |
+ title: chrome.i18n.getMessage("notification_open_all") |
} |
]; |
} |
if (!["critical", "relentless"].includes(notificationType)) |
{ |
buttons.push({ |
type: "configure", |
- title: ext.i18n.getMessage("notification_configure") |
+ title: chrome.i18n.getMessage("notification_configure") |
}); |
} |
} |
return buttons; |
} |
function openNotificationLinks() |
@@ -205,17 +205,17 @@ |
// We use the highest priority to prevent the notification |
// from closing automatically. |
priority: 2 |
}); |
} |
else if ("Notification" in window && activeNotification.type != "question") |
{ |
if (linkCount > 0) |
- message += " " + ext.i18n.getMessage("notification_without_buttons"); |
+ message += " " + chrome.i18n.getMessage("notification_without_buttons"); |
let widget = new Notification( |
title, |
{ |
lang: Utils.appLocale, |
dir: Utils.readingDirection, |
body: message, |
icon: iconUrl |
@@ -224,17 +224,17 @@ |
widget.addEventListener("click", openNotificationLinks); |
widget.addEventListener("close", notificationClosed); |
} |
else |
{ |
message = title + "\n" + message; |
if (linkCount > 0) |
- message += "\n\n" + ext.i18n.getMessage("notification_with_buttons"); |
+ message += "\n\n" + chrome.i18n.getMessage("notification_with_buttons"); |
let approved = confirm(message); |
if (activeNotification.type == "question") |
notificationButtonClick(approved ? 0 : 1); |
else if (approved) |
openNotificationLinks(); |
} |
} |