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

Unified Diff: lib/notificationHelper.js

Issue 29371739: Issue 4722 - Remove old check for Chrome notification API (Closed)
Patch Set: Inline chrome.notification check Created Jan. 16, 2017, 2:28 p.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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/notificationHelper.js
diff --git a/lib/notificationHelper.js b/lib/notificationHelper.js
index 84f34b3dcf966543a918bfae43efc78bd6565fbe..9a8875a3ecb3c8357397763406546df3c9371be6 100644
--- a/lib/notificationHelper.js
+++ b/lib/notificationHelper.js
@@ -33,21 +33,6 @@ displayMethods.question = ["notification"];
displayMethods.normal = ["notification"];
displayMethods.information = ["icon", "popup"];
-// Chrome on Linux does not fully support chrome.notifications until version 35
-// https://code.google.com/p/chromium/issues/detail?id=291485
-let canUseChromeNotifications = (function()
-{
- let info = require("info");
- if (info.platform == "chromium" && "notifications" in chrome)
- {
- if (navigator.platform.indexOf("Linux") == -1)
- return true;
- if (Services.vc.compare(info.applicationVersion, "35") >= 0)
- return true;
- }
- return false;
-})();
-
function prepareNotificationIconAndPopup()
{
let animateIcon = shouldDisplay("icon", activeNotification.type);
@@ -195,7 +180,7 @@ function showNotification(notification)
let iconUrl = ext.getURL("icons/detailed/abp-128.png");
let linkCount = (activeNotification.links || []).length;
- if (canUseChromeNotifications)
+ if ("notifications" in chrome)
{
activeButtons = getNotificationButtons(activeNotification.type, texts.message);
chrome.notifications.create("", {
@@ -246,7 +231,7 @@ function showNotification(notification)
*/
exports.initNotifications = function()
{
- if (canUseChromeNotifications)
+ if ("notifications" in chrome)
initChromeNotifications();
initAntiAdblockNotification();
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld