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

Side by Side Diff: messageResponder.js

Issue 29555782: Issue 5701 - Inconsistent forum links and DNT link (Closed)
Patch Set: Use placeholder for application Created Sept. 25, 2017, 8:47 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 | « no previous file | new-options.html » ('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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 port.on("app.get", (message, sender) => 149 port.on("app.get", (message, sender) =>
150 { 150 {
151 if (message.what == "issues") 151 if (message.what == "issues")
152 { 152 {
153 let subscriptionInit = require("subscriptionInit"); 153 let subscriptionInit = require("subscriptionInit");
154 let result = subscriptionInit ? subscriptionInit.reinitialized : false; 154 let result = subscriptionInit ? subscriptionInit.reinitialized : false;
155 return {filterlistsReinitialized: result}; 155 return {filterlistsReinitialized: result};
156 } 156 }
157 157
158 if (message.what == "doclink") 158 if (message.what == "doclink")
159 return Utils.getDocLink(message.link); 159 {
160 let {application, platform} = info;
Sebastian Noack 2017/09/25 21:03:22 Nit: I personally wouldn't assign "platform" to a
saroyanm 2017/09/25 21:21:45 Done.
161 if (platform == "chromium" && application != "opera")
162 application = "chrome";
163 else if (platform == "gecko")
164 application = "firefox";
165
166 let link = message.link.replace("{application}", application);
167 return Utils.getDocLink(link);
Sebastian Noack 2017/09/25 21:03:22 Nit: Why a temporary variable, and not just return
saroyanm 2017/09/25 21:17:33 Exceeded 80 char limit.
saroyanm 2017/09/25 21:28:00 Done.
168 }
160 169
161 if (message.what == "localeInfo") 170 if (message.what == "localeInfo")
162 { 171 {
163 let bidiDir; 172 let bidiDir;
164 if ("chromeRegistry" in Utils) 173 if ("chromeRegistry" in Utils)
165 { 174 {
166 let isRtl = Utils.chromeRegistry.isLocaleRTL("adblockplus"); 175 let isRtl = Utils.chromeRegistry.isLocaleRTL("adblockplus");
167 bidiDir = isRtl ? "rtl" : "ltr"; 176 bidiDir = isRtl ? "rtl" : "ltr";
168 } 177 }
169 else 178 else
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 if (message.url) 434 if (message.url)
426 subscriptions = [Subscription.fromURL(message.url)]; 435 subscriptions = [Subscription.fromURL(message.url)];
427 436
428 for (let subscription of subscriptions) 437 for (let subscription of subscriptions)
429 { 438 {
430 if (subscription instanceof DownloadableSubscription) 439 if (subscription instanceof DownloadableSubscription)
431 Synchronizer.execute(subscription, true); 440 Synchronizer.execute(subscription, true);
432 } 441 }
433 }); 442 });
434 })(this); 443 })(this);
OLDNEW
« no previous file with comments | « no previous file | new-options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld