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

Side by Side Diff: lib/stats.js

Issue 29570614: Issue 5028 - Use browser namespace (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Use polyfill.js Created Oct. 10, 2017, 10: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/requestBlocker.js ('k') | lib/subscriptionInit.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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 { 60 {
61 page.browserAction.setBadge({ 61 page.browserAction.setBadge({
62 color: badgeColor, 62 color: badgeColor,
63 number: blocked 63 number: blocked
64 }); 64 });
65 } 65 }
66 }); 66 });
67 67
68 Prefs.on("show_statsinicon", () => 68 Prefs.on("show_statsinicon", () =>
69 { 69 {
70 chrome.tabs.query({}, tabs => 70 browser.tabs.query({}, tabs =>
71 { 71 {
72 for (let tab of tabs) 72 for (let tab of tabs)
73 { 73 {
74 let page = new ext.Page(tab); 74 let page = new ext.Page(tab);
75 let badge = null; 75 let badge = null;
76 76
77 if (Prefs.show_statsinicon) 77 if (Prefs.show_statsinicon)
78 { 78 {
79 let blocked = blockedPerPage.get(page); 79 let blocked = blockedPerPage.get(page);
80 if (blocked) 80 if (blocked)
81 { 81 {
82 badge = { 82 badge = {
83 color: badgeColor, 83 color: badgeColor,
84 number: blocked 84 number: blocked
85 }; 85 };
86 } 86 }
87 } 87 }
88 88
89 page.browserAction.setBadge(badge); 89 page.browserAction.setBadge(badge);
90 } 90 }
91 }); 91 });
92 }); 92 });
93 93
94 port.on("stats.getBlockedPerPage", 94 port.on("stats.getBlockedPerPage",
95 message => getBlockedPerPage(new ext.Page(message.tab))); 95 message => getBlockedPerPage(new ext.Page(message.tab)));
OLDNEW
« no previous file with comments | « lib/requestBlocker.js ('k') | lib/subscriptionInit.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld