Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: background.js

Issue 5767063142400000: notification fixes (Closed)
Patch Set: Nit fix for long lines Created March 6, 2014, 10:10 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/ext/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: background.js
===================================================================
--- a/background.js
+++ b/background.js
@@ -347,7 +347,11 @@
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)
{
var opts = {
type: "basic",
@@ -362,7 +366,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);
« no previous file with comments | « no previous file | chrome/ext/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld