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

Side by Side Diff: lib/notificationHelper.js

Issue 29573801: Issue 4580 - Replace ext.getURL with extension.getURL (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created Oct. 11, 2017, 4:15 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/filterComposer.js ('k') | lib/options.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 { 182 {
183 if (activeNotification && activeNotification.id == notification.id) 183 if (activeNotification && activeNotification.id == notification.id)
184 return; 184 return;
185 185
186 activeNotification = notification; 186 activeNotification = notification;
187 if (shouldDisplay("notification", activeNotification.type)) 187 if (shouldDisplay("notification", activeNotification.type))
188 { 188 {
189 let texts = NotificationStorage.getLocalizedTexts(notification); 189 let texts = NotificationStorage.getLocalizedTexts(notification);
190 let title = texts.title || ""; 190 let title = texts.title || "";
191 let message = (texts.message || "").replace(/<\/?(a|strong)>/g, ""); 191 let message = (texts.message || "").replace(/<\/?(a|strong)>/g, "");
192 let iconUrl = ext.getURL("icons/detailed/abp-128.png"); 192 let iconUrl = chrome.extension.getURL("icons/detailed/abp-128.png");
193 let linkCount = (activeNotification.links || []).length; 193 let linkCount = (activeNotification.links || []).length;
194 194
195 if ("notifications" in chrome) 195 if ("notifications" in chrome)
196 { 196 {
197 activeButtons = getNotificationButtons(activeNotification.type, 197 activeButtons = getNotificationButtons(activeNotification.type,
198 texts.message); 198 texts.message);
199 chrome.notifications.create("", { 199 chrome.notifications.create("", {
200 type: "basic", 200 type: "basic",
201 title, 201 title,
202 iconUrl, 202 iconUrl,
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 let methods = displayMethods[notificationType] || defaultDisplayMethods; 275 let methods = displayMethods[notificationType] || defaultDisplayMethods;
276 return methods.includes(method); 276 return methods.includes(method);
277 }; 277 };
278 278
279 ext.pages.onLoading.addListener(page => 279 ext.pages.onLoading.addListener(page =>
280 { 280 {
281 NotificationStorage.showNext(stringifyURL(page.url)); 281 NotificationStorage.showNext(stringifyURL(page.url));
282 }); 282 });
283 283
284 NotificationStorage.addShowListener(showNotification); 284 NotificationStorage.addShowListener(showNotification);
OLDNEW
« no previous file with comments | « lib/filterComposer.js ('k') | lib/options.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld