Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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 Loading... | |
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} = info; | |
161 if (info.platform == "chromium" && application != "opera") | |
162 application = "chrome"; | |
163 else if (info.platform == "gecko") | |
164 application = "firefox"; | |
165 | |
166 return Utils.getDocLink(message.link.replace("{browser}", application)); | |
167 } | |
160 | 168 |
161 if (message.what == "localeInfo") | 169 if (message.what == "localeInfo") |
162 { | 170 { |
163 let bidiDir; | 171 let bidiDir; |
164 if ("chromeRegistry" in Utils) | 172 if ("chromeRegistry" in Utils) |
165 { | 173 { |
166 let isRtl = Utils.chromeRegistry.isLocaleRTL("adblockplus"); | 174 let isRtl = Utils.chromeRegistry.isLocaleRTL("adblockplus"); |
167 bidiDir = isRtl ? "rtl" : "ltr"; | 175 bidiDir = isRtl ? "rtl" : "ltr"; |
168 } | 176 } |
169 else | 177 else |
170 bidiDir = Utils.readingDirection; | 178 bidiDir = Utils.readingDirection; |
171 | 179 |
172 return {locale: Utils.appLocale, bidiDir}; | 180 return {locale: Utils.appLocale, bidiDir}; |
173 } | 181 } |
174 | 182 |
175 if (message.what == "features") | 183 if (message.what == "features") |
176 { | 184 { |
177 return { | 185 return { |
178 devToolsPanel: info.platform == "chromium" | 186 devToolsPanel: info.platform == "chromium" |
179 }; | |
180 } | |
181 | |
182 if (message.what == "browserInfo") | |
Sebastian Noack
2017/09/25 17:09:22
Just an idea; how about merging the logic into the
saroyanm
2017/09/25 18:07:53
Don't have strong opinion, on one hand it makes th
Sebastian Noack
2017/09/25 19:07:47
Also note that the reason you introduced "browserI
saroyanm
2017/09/25 20:50:12
I agree with you, looks much more better now.
Done
| |
183 { | |
184 return { | |
185 platform: info.platform, | |
186 application: info.application | |
187 }; | 187 }; |
188 } | 188 } |
189 | 189 |
190 return info[message.what]; | 190 return info[message.what]; |
191 }); | 191 }); |
192 | 192 |
193 port.on("app.listen", (message, sender) => | 193 port.on("app.listen", (message, sender) => |
194 { | 194 { |
195 getListenerFilters(sender.page).app = message.filter; | 195 getListenerFilters(sender.page).app = message.filter; |
196 }); | 196 }); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
433 if (message.url) | 433 if (message.url) |
434 subscriptions = [Subscription.fromURL(message.url)]; | 434 subscriptions = [Subscription.fromURL(message.url)]; |
435 | 435 |
436 for (let subscription of subscriptions) | 436 for (let subscription of subscriptions) |
437 { | 437 { |
438 if (subscription instanceof DownloadableSubscription) | 438 if (subscription instanceof DownloadableSubscription) |
439 Synchronizer.execute(subscription, true); | 439 Synchronizer.execute(subscription, true); |
440 } | 440 } |
441 }); | 441 }); |
442 })(this); | 442 })(this); |
LEFT | RIGHT |