Index: background.js |
=================================================================== |
--- a/background.js |
+++ b/background.js |
@@ -347,7 +347,8 @@ |
var message = texts.message ? texts.message.replace(/<\/?(a|strong)>/g, "") : ""; |
var iconUrl = ext.getURL("icons/abp-128.png"); |
var hasLinks = activeNotification.links && activeNotification.links.length > 0; |
- if ("browserNotifications" in ext) |
+ // Chrome on Linux does not fully support chrome.notifications yet ( https://code.google.com/p/chromium/issues/detail?id=291485 ) |
+ if (require("info").platform == "chromium" && "notifications" in chrome && navigator.platform.indexOf("Linux") == -1) |
Sebastian Noack
2014/03/06 09:58:31
Nit: Those are two very long lines. We usually try
saroyanm
2014/03/06 10:11:15
Will keep in mind,thanks.
Done.
|
{ |
var opts = { |
type: "basic", |
@@ -362,7 +363,7 @@ |
while (match = regex.exec(plainMessage)) |
opts.buttons.push({title: match[1]}); |
- var notification = ext.browserNotifications; |
+ var notification = chrome.notifications; |
notification.create("", opts, function() {}); |
notification.onClosed.addListener(prepareNotificationIconAndPopup); |
notification.onButtonClicked.addListener(notificationButtonClick); |